Install MySQL as an rpm package, and mysql as an rpm package

Source: Internet
Author: User

Install MySQL as an rpm package, and mysql as an rpm package

1. Download the rpm package required for Mysql Installation

http://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpmhttp://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpmhttp://cdn.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

 

2. Installation

[root@Luxh-01 softs]# rpm -ivh MySQL-server-5.6.21-1.linux_glibc2.5.x86_64.rpm 
[root@Luxh-01 softs]# rpm -ivh MySQL-client-5.6.21-1.linux_glibc2.5.x86_64.rpm
[root@Luxh-01 softs]# rpm -ivh MySQL-devel-5.6.21-1.linux_glibc2.5.x86_64.rpm

During the installation process, Mysql will generate a random password for the root user, and the password is stored in/root/. mysql_secret.

MySQL installation directory information:

Directory Contents of Directory
/usr/bin Client programs and scripts
/usr/sbin TheMysqldServer
/var/lib/mysql Log files, databases
/usr/share/info Manual in Info format
/usr/share/man Unix manual pages
/usr/include/mysql Include (header) files
/usr/lib/mysql Libraries
/usr/share/mysql Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation
/usr/share/sql-bench Benchmarks

 

3. Start MySQL:

[Root @ Luxh-01 ~] # Service mysql startStarting MySQL... [OK] [root @ Luxh-01 ~] # Service mysql statusMySQL running (3270) [OK]

 

4. log on to MySQL

[root@Luxh-01 ~]# mysql -uroot -p

Enter the random password generated during installation to log on to the MySQL command line interface.

 

5. Modify the root user password

mysql> set password = password('123456');

 

6. Copy/usr/share/mysql/my-default.cnf to/etc/my. cnf

[root@Luxh-01 mysql]# pwd/usr/share/mysql[root@Luxh-01 mysql]# cp my-default.cnf /etc/my.cnf[root@Luxh-01 mysql]# 

You can modify/etc/my. cnf as needed, and then restart mysql.

 

7. Allow Remote root Login

mysql> grant all on *.* to root@'%' identified by "123456";Query OK, 0 rows affected (0.02 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)mysql> 

 

 

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.