安装Mysql 5.7 on fedora23 kde
2015-12-07 13:45
309 查看
安装有多种方式,可以添加源之后直接,更新源,dnf install mysql_server
也可以下载apm包之后直接 rpm install ,初次安装可能需要安装一个包。
资料来自mysql文档
源网站
Installing and Upgrading MySQL
这个是一些安装完之后msql的一些文件分布Table 2.9 MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone(cp from http://dev.mysql.com/doc)
Files or Resources | Location |
---|---|
Client programs and scripts | /usr/bin |
mysqld server | /usr/sbin |
Configuration file | /etc/my.cnf |
Data directory | /var/lib/mysql |
Error log file | For RHEL, Oracle Linux, CentOS or Fedora platforms: /var/log/mysqld.log For SLES: /var/log/mysql/mysqld.log |
Value of secure_file_priv | /var/lib/mysql-files |
System V init script | For RHEL, Oracle Linux, CentOS or Fedora platforms: /etc/init.d/mysqld For SLES: /etc/init.d/mysql |
Systemd service | For RHEL, Oracle Linux, CentOS or Fedora platforms: mysqld For SLES: mysql |
Pid file | /var/run/mysql/mysqld.pid |
Unix manual pages | /usr/share/man |
Include (header) files | /usr/include/mysql |
Libraries | /usr/lib/mysql |
Socket | /var/lib/mysql/mysql.sock |
Miscellaneous support files (for example, error messages and character set files) | /usr/share/mysql |
shell> [code]service mysqld start
然后我们就可以在mysql相关日志文件中搜索初始密码啦,查看一下目录,可以尝试下面两个命令
shell> [code]grep 'temporary password' /var/log/mysqld.log
shell> [code]grep 'temporary password' /var/log/mysql/mysqld.log
mysql -uroot -p 输入所查询到的密码即可进入熟悉的mysql
At the initial start up of the server, the following happens, given that the data directory of the server is empty:
The server is initialized.
An SSL certificate and key files are generated in the data directory.
The validate_password
plugin is installed and enabled.
A superuser account
'root'@'localhost'is
created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command for RHEL, Oracle Linux, CentOS, and Fedora platform:
shell> [code]grep 'temporary password' /var/log/mysqld.log
[/code]
Use the following command for SLES platform:
shell> [code]grep 'temporary password' /var/log/mysql/mysqld.log
[/code]
The next step is to log in with the generated, temporary password and set a custom password for the superuser account:
shell> [code]mysql -uroot -p
[/code]
mysql> [code]ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
[/code]
Note
MySQL's validate_password plugin
is installed by default. This will require that passwords contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.
If something goes wrong during installation, you might find debug information in the error log file
/var/log/mysqld.log.
Compatibility
with RPM Packages from Other Vendors. If you have installed packages for MySQL from your Linux distribution's local software repository, it is much preferable to install the new, directly-downloaded packages from Oracle using the package management
system of your platform (yum, dnf,
orzypper),
as described above. The command replaces old packages with new ones to ensure compatibility of old applications with the new installation; for example, the old
mysql-libspackage
is replaced with the
mysql-community-libs-compatpackage,
which provides a replacement-compatible client library for applications that were using your older MySQL installation. If there was an older version of
mysql-community-libs-compaton
the system, it also gets replaced.
If you have installed third-party packages for MySQL that are NOT from your Linux distribution's local software repository (for example, packages directly downloaded from a vendor other than Oracle), you should uninstall all those packages before installing
the new, directly-downloaded packages from Oracle. This is because conflicts may arise between those vendor's RPM packages and Oracle's: for example, a vendor's convention about which files belong with the server and which belong with the client library may
differ from that used for Oracle packages. Attempts to install an Oracle RPM may then result in messages saying that files in the RPM to be installed conflict with files from an installed package.
Debug Package. A special variant of MySQL Server compiled with the debug
package has been included in the server RPM packages. It performs debugging and memory allocation checks and produces a trace file when the server is running. To use that debug version, start MySQL with
/usr/sbin/mysqld-debug,
instead of starting it as a service or with
/usr/sbin/mysqld.
See Section
24.5.3, “The DBUG Package” for the debug options you can use.
Rebuilding RPMs from source SRPMs. Source code SRPM packages for MySQL are available from the MySQL Yum repository. They
can be used as-is to rebuild the MySQL RPMs with the standard rpmbuild tool
chain.
rootpasswords
for pre-GA releases. For MySQL 5.7.4 and 5.7.5, the initial random
rootpassword
is written to the
.mysql_secretfile
in the directory named by the
HOMEenvironment
variable. When trying to access the file, bear in mind that depending on operating system, using a command such as sudomay
cause the value of
HOMEto refer to
the home directory of the
rootsystem
user .
.mysql_secretis created with
mode 600 to be accessible only to the system user for whom it is created. Before MySQL 5.7.4, the accounts (including
root)
created in the MySQL grant tables for an RPM installation initially have no passwords; after starting the server, you should assign passwords to them using the instructions in Section
2.10, “Postinstallation Setup and Testing”."
( ¯(∞)¯ )祝小伙伴们,成功安装,并进入mysql~
相关文章推荐
- JSP内置对象
- jQuery实现的虚拟键盘
- 一个靠谱的自动悬浮的导航栏(笔记)
- jQuery高亮显示文本中重要的关键字
- js 获得日期相差天数
- css基础
- Angular.js学习笔记(五)
- js格式化日期 年月日
- js 精确小数俩位
- jquery 下拉框改变 事件 动态显示input
- MVC HtmlHelper用法大全
- JS快速获取图片宽高的方法
- jQuery设计思想
- H5网页判断手机横屏或是竖屏
- 【JSON解析】JSON解析高手
- JS与jQuery遍历Table所有单元格内容的方法
- 今天大雪 看雪花飘落HTML5特效
- JS学习笔记
- js正则表达式
- [CSS3] opacity & alpha (rgba)