1.linux version of MySQL download (recommended not under 5.7, the installation of various bugs Ah, 5.6 is the best)
to MySQL website download mysql compiled binary installation package, on the download page select Platform: Option Select Linux-generic, then pull the page to the bottom, 64-bit system download linux-generic (GLIBC 2.5) (x86, 64-bit), 32-bit system download linux-generic (GLIBC 2.5) (x86, 32-bit)
2. Unzip the installation package
Go to the directory where the installation package is located, execute the command: Tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz
3. Copy the extracted MySQL directory to the local software directory of the system:
Execute command: CP mysql-5.6.17-linux-glibc2.5-i686/usr/local/mysql-r
Note: The end of the directory does not add/
4. Add the system MySQL group and the MySQL User:
Execute command: Groupadd MySQL and useradd-r-g MySQL MySQL
5. Install the database
Go to install MySQL software directory: Execute command cd/usr/local/mysql
Modify current directory owner for MySQL User: Execute command chown-r mysql:mysql.
Install database: Executes the command./scripts/mysql_install_db--user=mysql
Modify the current directory owner as root User: Execute command chown-r root:root.
Modify the current data directory owner for MySQL User: Execute command chown-r mysql:mysql data
To this database installation is complete
6. Start the MySQL service and add the boot MySQL service:
Add Boot: Execute command CP Support-files/mysql.server/etc/init.d/mysql, put startup script into boot initialization directory
Start MySQL service: Execute command service MySQL start
Execute command: ps-ef|grep mysql see MySQL service description started successfully
7. Change the root password of MySQL, the root initial password is empty:
Execute command:./bin/mysqladmin-u root password ' password ' (single quotes must have, representing strings)
8. Place the MySQL client in the default path:
N-/usr/local/mysql/bin/mysql/usr/local/bin/mysql
Note: It is recommended to use the soft chain in the past, do not directly package file copy, easy to install multiple versions of MySQL system
Above more detailed content address: http://jingyan.baidu.com/article/a378c9609eb652b3282830fd.html
Note the problem:
Self-feeling MySQL 5.7 This series of versions are all twisted, whether it's Windows or Linux, there's always a little bit of a confusing idea when it comes to installation. Originally installed in Windows MySQL, young not sensible under the 5.7 version, the results appear a variety of elusive bugs, in the online search can not find, finally found a Freemasonry people complain is the version of the problem, pretend to be 5.6 good. And this time installed Linux, young frivolous I forgot the lesson under Windows, loaded 5.7, the result has been a variety of bugs, eh, or too young. I hope we can learn from it.
9. Use after installation
After installation, you can enter mysql-uroot-p, then enter password to enter MySQL.
You can use the various syntax of MySQL, first you can view Database:show databases.
Reprint please indicate source: http://www.cnblogs.com/fnlingnzb-learner/p/5830622.html Thank you!
Install MySQL under Linux