mysql initialization

Start mysql server:
/usr/sbin/service mysqld startmysql

Check the root password:
$sudo grep 'temporary password' /var/log/mysqld.logsql

2019-03-30T12:44:15.258452Z 1 [Note] A temporary password is generated for root@localhost: ZK3<r.j5H;o?server

Change the password immediately:
$mysql -u root -pit

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'PseudoTest@';test

Create a user named with cdctest
mysql> CREATE USER cdctest IDENTIFIED BY 'Pseudo4UI@';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'cdctest'@'localhost' IDENTIFIED BY 'PseudoTest@';file

$mysql -u cdctest -pservice

Create a new database named with "GATEST"
mysql> CREATE DATABASE gatest;
msql> use gatest;grep

Restart the databse from the file:
$mysql -u cdctest -p --database=gatest < gatest-mysql.sqlim

相关文章
相关标签/搜索