Installing Linux on top of mysql5.7.28

1. Download the installation package msyql 

 

 2. software to upload the archive to go on top of linux

 

 3. The compressed decompression, rename

mv mysql .......... (folder name) mysql

4. msyql into the / usr / loca under

cp -r mysql /usr/local

5. Add in the data directory mysql

[root@localhost ~]# mkdir /usr/local/mysql/data

6. Change the mysql directory under all the directories and folders belongs to a combination of user

 
[root@localhost /]# cd /usr/local/ 
[root@localhost local]# chown -R mysql:mysql mysql/
[root@localhost local]# chmod -R 755 mysql/

7. Compile installed and initialized mysql, remember the password at the end of the command line:

[root@localhost local]# /usr/local/mysql/bin/mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
2017-08-31T08:50:23.910440Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-31T08:50:23.910635Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/--datadir=/usr/local/mysql/data/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' con
figuration directive.2017-08-31T08:50:24.709286Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-08-31T08:50:24.767540Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-08-31T08:50:24.892629Z 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: 6e083b8f-8e29-11e7-88b1-
005056b427be.2017-08-31T08:50:24.895674Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-08-31T08:50:24.896645Z 1 [Note] A temporary password is generated for root@localhost: gFamcspKm2+u

8. Start mysql service

[root@localhost local]# /usr/local/mysql/support-files/mysql.server start

9. Be soft links to restart the service

[root@localhost local]# ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql 
[root@localhost local]# service mysql restart
Shutting down MySQL.. SUCCESS! 
Starting MySQL. SUCCESS!

10. Be soft links, will be installed on the mysql directory under / usr / bin directory

[root@localhost local]# ln -s /usr/local/mysql/bin/mysql /usr/bin

11. Log msyql, enter a password (password for password generation initialization step 7)

[root@localhost local]# mysql -u root -p
Enter password:

12. Change Password and Open and Distance

msql>alter user 'root'@'localhost' identified by '123456';
mysql>use mysql;
msyql>update user set user.Host='%' where user.User='root';
mysql>flush privileges;
mysql>quit

13. Edit my.cnf, add a profile, configure content

[root@localhost local]# vi /usr/local/mysql/my.cnf
[mysqld]
port = 3306
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

  

  

 

Guess you like

Origin www.cnblogs.com/huoyufei/p/11811976.html