One, wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm
二,yum localinstall mysql57-community-release-el6-8.noarch.rpm
Three, yum install mysql-server
四,mysqld --initialize --user=mysql
Fifth, find the password vi /var/log/mysqld.log
Six, modify the password mysqladmin -uroot -p password
Copy and paste, enter old password, set new password
七,chkconfig mysqld on
Eight, reboot
Nine, mysql -uroot -p
OK
Note: The yum installation will follow all the components required by mysql.
yum search xxx
yun install xxx
==========================================================
Briefly explain the process of installing MySQL 5.6.15 under Linux, I hope it will be useful to everyone.
1. Download MySQL 5.6
Download page: http://dev.mysql.com/downloads/mysql/
Here, select "Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 32-bit), RPM Bundle" to download, download it to the /root/Downloads/ directory, and the download file name is "MySQL-5.6.15-1.el6" .i686.rpm-bundle.tar”
2. Unzip the tar package
cd /root/Downloads/
tar -xvf MySQL-5.6.15-1.el6.i686.rpm-bundle.tar
3. Install MySQL as RPM
In the RHEL system, the compatibility package "MySQL-shared-compat-5.6.15-1.el6.i686.rpm" must be installed first, and then the server and client can be installed, otherwise an error will occur during installation.
yum install MySQL-shared-compat-5.6.15-1.el6.i686.rpm # RHEL compatibility package
yum install MySQL-server-5.6.15-1.el6.i686.rpm # MySQL server program
yum install MySQL-client-5.6.15-1.el6.i686.rpm # MySQL client program
yum install MySQL-devel-5.6.15-1.el6.i686.rpm # MySQL library and header files
yum install MySQL-shared-5.6.15-1.el6.i686.rpm # MySQL shared library
4. Configure MySQL login password
cat /root/.mysql_secret # Get the random password generated during MySQL installation
service mysql start # Start the MySQL service
mysql -uroot -p # Enter MySQL and use the random password obtained before
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password'); # Set the password of the root account to password on the MySQL command line
quit # Exit the MySQL command line
service mysql restart # Restart the MySQL service
==========================================================
1. Check the mysql version
Method 1: status;
Method 2: select version();
2, Mysql start, stop, restart common commands
a. Startup method
1. Start with service:
[root@localhost /]# service mysqld start (5.0 version is mysqld)
[root@szxdb etc]# service mysql start (version 5.5.7 is mysql)
2. Start using the mysqld script:
/etc/inint.d/mysqld start
3. Start with safe_mysqld:
safe_mysqld&
b. to stop
1. Start with service:
service mysqld stop
2. Start using the mysqld script:
/etc/inint.d/mysqld stop
3、mysqladmin shutdown
c. restart
1. Start with service:
service mysqld restart
service mysql restart (command in version 5.5.7)
2. Start using the mysqld script:
/etc/init.d/mysqld restart