Install MySQL steps

Source: Internet
Author: User

1.yum Install Lrzsz installation upload function
2. Check to see if the system is equipped with Mysql:rpm-qa | grep MySQL
3. View system MySQL location: Whereis MySQL
4. Uninstall Mysql:yum-y Remove mysql-libs.x86_64
5. View the MySQL version on the Yum library Yum list | grep MySQL or yum-y list mysql*
6. View the current Linux version command cat/procersion
7. Download to http://mirrors.sohu.com/mysql/MySQL-5.6/
Mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz
8. Upload and unzip the tar package.


9. Install the database, or you will be prompted without a table
. Install the database
CD mysql-5.6.21/scripts (database installation directory)
./mysql_install_db--user=mysql--basedir=/(Database installation directory)--datadir=/(Database storage directory)
For example:
./mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data/mysqldata/data

Exit


10.CP my-default.cnf/etc/my.cnf
CP Mysql.server/etc/init.d/mysql


11. Configure Environment variables
Vim/etc/profile
Export Mysql_home= "/software/mysql-5.6.21"
Export path= "$PATH: $MYSQL _home/bin"
Save exit
. /etc/profile

11. Allow environment variables to take effect quickly
Source/etc/profile

12. Add MySQL User
Groupadd MySQL
Useradd-r-G MySQL MySQL
Assigning folder permissions to MySQL users
Chown-r mysql:mysql [MySQL installation folder]
Get

/etc/init.d/mysql start



13 in-Database
Mysql-uroot-p Setting a password
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' Your_password ' with GRANT OPTION;

#允许root用户远程访问


14 Modify MySQL Password:
Set password for ' root ' @ ' localhost ' =password (' new password ');
For example
Set password = password (' xxx ');
Or
Set password for ' root ' @ ' localhost ' =password (' 123456 ');



The workaround for the user table could not be found:
/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--

datadir=/data/mysqldata/data&


Stop MySQL
cd/usr/local/mysql/
scripts/mysql_install_db--user=mysql
from MySQL




./bin/mysqld_safe--basedir=/data/mysql--datadir=/data/mysql-5.6.21/data--skip-grant-tables &

Install MySQL steps

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.