标签:val lte ODB note start new 群组 更改 ase
obd:~ # groupadd mysql
obd:~ # useradd -g mysql mysql
obd:~ # mkdir -p /opt/mysql/data
obd:~ # mkdir -p /opt/mysql/tmp
tar -zxvf mysql-5.7.11-Linux-glibc2.5-x86_64.tar.gz
mv mysql-5.7.11-Linux-glibc2.5-x86_64 mysql
mv mysql /opt/
bin/mysqld --initialize --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/data ---注意记下初始密码
obd:/opt/mysql # bin/mysqld --initialize --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/data
2018-11-15T10:17:50.782341Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-11-15T10:17:51.195532Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-11-15T10:17:51.266087Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-11-15T10:17:51.336775Z 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: b553d43d-e8bf-11e8-84c5-000c296c182a.
2018-11-15T10:17:51.341835Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened.
2018-11-15T10:17:51.344683Z 1 [Note] A temporary password is generated for root@localhost: !kt6ul-e&u3J
cp support-files/my-default.cnf /etc/my.cnf
vim /etc/my.cnf
[client]
socket = /opt/mysql/tmp/mysql.sock
[mysqld]
basedir = /opt/mysql
datadir = /opt/mysql/data
port = 3306
socket = /opt/mysql/tmp/mysql.sock
chgrp -R mysql .
chown -R root .
chown -R mysql data
chown -R mysql.mysql ../mysql
cp support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
/opt/mysql/bin
ln -s /opt/mysql/bin/mysql /usr/local/bin
ln -s /opt/mysql/bin/mysqladmin /usr/local/bin
ln -s /opt/mysql/bin/mysqld_safe /usr/local/bin
service mysql start
mysql -u root -p ---初始密码
alter user root@localhost identified by ‘123456‘;
use mysql;
grant all privileges on *.* to root@‘%‘ identified by "123456";
flush privileges; ---立即生效
select host, user from user;
标签:val lte ODB note start new 群组 更改 ase
原文地址:https://www.cnblogs.com/csyd/p/10370616.html