The first time I came into contact with the server version Linux: javastuserver12.04, it was also the first time I installed binary mysql with a command line. It took two days and one night, and it was quite painful. Leave for memo! First, download the mysql package of the binary version: mysql
The first time I came into contact with the Server version of Linux: Ubuntu Server 12.04, it was also the first time I installed binary mysql with command lines. It took two days and one night to get started. Leave for memo!
First download the binary mysql package: http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
Because wget on Ubuntu Server is slow, I downloaded it directly with thunder on windows and uploaded it to the Server using WinSCP.
Correct question.
Package in ~ In the/Download directory, all the installation commands are as follows:
1、decompress tar.gz
Tar-xzf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
2. Rename the decompressed folder
Music mysql-5.6.10-linux-glibc2.5-x86_64 mysql
3. Move the mysql folder to the/usr/local directory.
Sudo mv mysql/usr/local
4. Go to the mysql directory
Cd/usr/local/mysql
5. Add a mysql user group
Sudo groupadd mysql
6. Add mysql users
Sudo useradd-r-g mysql
7. Change the mysql folder own and grp to mysql
Sudo chown-R mysql.
Sudo chgrp-R mysql.
8. Execute the mysql installation script
Sudo scripts/mysql_install_db -- user = mysql
(If the libaio package is not installed, an error message is displayed. After libaio-dev is installed, run the script again)
Sudo apt-get install libaio-dev
9. Change the directory permission back and only keep the data directory as a mysql user
Sudo chown-R root.
Sudo chown-R mysql data
10. Copy the mysql configuration file to the etc directory (global configuration)
Note: The default configuration file name of version 5.6 is changed from my-medium to my-default.
Sudo cp support-files/my-default.cnf/etc/my. cnf
11. Start mysql
Sudo bin/mysqld_safe -- user = mysql &
12. initialize the mysql root User Password
Sudo bin/mysqladmin-u root password 'password text'
13. Copy the mysql. server script to/etc/init. d (initialize the service. Some people prefer to change it to mysqld. You can change it here)
Sudo cp support-files/mysql. server/etc/init. d/mysql. server
14. view the mysql running status
Sudo service mysql. server status
If it runs normally, MySQL running is displayed.
If not running is displayed, the service is not started before. You can directly start it with service mysql. server start.
Sudo service mysql. server [status | start | stop]
15. Enable mysql to start [defaults], and disable [remove]
Sudo update-rc.d-f mysql. server defaults [remove]
16. Add the mysql/bin/mysql command to the USER command, or add the mysql/bin directory to the path
Add USER command:
Sudo ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql
Add environment variables:
Export PATH = $ PATH:/usr/local/mysql/bin
17. Allow the root user to log on remotely.
1> enter mysql: mysql-u root-p
2> change the database: use mysql;
3> log on from any host: grant all privileges on *. * to root @ "%" identified by "Password text" with grant option;
4> log on from the specified host: grant all privileges on *. * to root @ "192.168.1.101" identified by "passw0rd" with grant option;
5> authorization takes effect: flush privileges;
6> check if the host is % authorized to add: select * from user;
18. Try a client.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2