作者:取个名字忒难le | 来源:互联网 | 2023-09-12 12:14
编译参数
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/web_servie/mysql -DMYSQL_DATADIR=/usr/local/web_servie/mysql/data -DMYSQL_UNIX_ADDR=/usr/local/web_servie/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/web_servie/mysql/data/ -DMYSQL_TCP_PORT=3306 -DWITH_SYSTEMD=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/src/boost_1_59_0/
一些设置
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysql /usr/local/web_servie/mysql
rm /etc/my.cnf
初始化命令
/usr/local/web_servie/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/web_servie/mysql --datadir=/usr/local/web_servie/mysql/data
初始化后的输出
2016-01-06T23:14:04.704711Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-06T23:14:05.100363Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-01-06T23:14:05.154067Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-01-06T23:14:05.214424Z 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: 2e4292f5-b4cb-11e5-a5bf-000c29cdedc7.
2016-01-06T23:14:05.215641Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-01-06T23:14:05.216716Z 1 [Note] A temporary password is generated for root@localhost : 9VC/1+rZkwOA
启动mysql
/usr/local/web_servie/mysql/support-files/mysql.server start
结果
Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/web_servie/mysql/bin/mysqld_safe)
尝试修改配置文件
cp /usr/local/web_servie/mysql/support-files/my-default.cnf /etc/my.cnf
编辑配置文件如下
[mysqld]
basedir = /usr/local/web_servie/mysql
datadir = /usr/local/web_servie/mysql/data
port = 3306
server_id = 1
socket = /usr/local/web_servie/mysql/mysql.sock
[mysql.server]
user=mysql
basedir=/usr/local/web_servie/mysql
[client]
port=3306
socket=/usr/local/web_servie/mysql/mysql.sock
再次启用
/usr/local/web_servie/mysql/support-files/mysql.server start
结果
Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/web_servie/mysql/bin/mysqld_safe)
网上的资料千篇一律,自己也试着修改了很多不同的配置,最后都是失败了。 求教。