mysql二进制包安装

Posted zqsb

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql二进制包安装相关的知识,希望对你有一定的参考价值。

./bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql57/ --datadir=/mysqldata

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

./bin/mysqld --initialize --datadir=/mysqldata

dadlI<t(k1Ek

首次安装

参考: https://www.cnblogs.com/oldAlcazar/p/6835573.html

[[email protected] mysql57]# ./bin/mysqld --initialize --datadir=/mysqldata
2019-03-26T02:35:50.743709Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-03-26T02:35:50.743828Z 0 [ERROR] Can‘t find error-message file ‘/usr/local/mysql/share/errmsg.sys‘. Check error-message file location and ‘lc-messages-dir‘ configuration directive.
2019-03-26T02:35:50.744762Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2019-03-26T02:35:50.744784Z 0 [ERROR] Aborting

再次初始化 ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/

[[email protected] mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
2019-03-26T02:39:41.951440Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-03-26T02:39:42.333828Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-03-26T02:39:42.408721Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-03-26T02:39:42.470209Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 68ccea0c-4f70-11e9-b878-0cc47a90c0aa.
2019-03-26T02:39:42.472276Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened.
2019-03-26T02:39:42.473157Z 1 [Note] A temporary password is generated for [email protected]: ca4DZJRog!SK

配置文件

cp -a ./support-files/my-default.cnf /etc/my.cnf
新下的软件包不存在 my-default.cnf 这个文件

启动报错:

[[email protected] mysql]# service mysqld start
Starting MySQL.2019-03-26T02:45:10.453082Z mysqld_safe Directory ‘/var/lib/mysql‘ for UNIX socket file don‘t exists.
The server quit without updating PID file (/usr/local/mysql[FAILED]calhost.localdomain.pid).

修改mysql.cnf中的socket文件: socket = /tmp/mysql.sock

进去需要先修改密码

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

修改密码; set password = password(‘ca4DZJRog#SK‘)
flush privileges

以上是关于mysql二进制包安装的主要内容,如果未能解决你的问题,请参考以下文章

二进制包离线安装mysql

mysql-5.5.56版本(二进制包安装)-自定义安装路径

LNMP之二进制MySQL的安装

mysql-5.7.18版本(二进制包安装)-自定义安装路径

Linux服务安装-手动安装Mysql 二进制包

Linux服务安装-手动安装Mysql 二进制包