MySQL installation linux_ binary package installation

Source: Internet
Author: User

1. Download (local download www.mysql.com----->downloads------>archives----->mysql Community Server---->linux- Generic) Example: Mysql-8.0.3-rc-linux-glibc2.12-x86_64.tar
(Download wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz online)
2. Unzip
TAR-ZXVF mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
MV Mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql
3. Create a MySQL user and install MySQL, initialize, specify the user as MySQL, specify the data storage address/data/mysqldata (no need to create)
Useradd MySQL
./scripts/mysql_install_db--user=mysql--datadir=/usr/local/data/mysqldata
4. Copy the MySQL template configuration file, the MySQL configuration file is stored under/etc/, and the name is fixed to MY.CNF, if you do not want to store in this directory, you need to specify the configuration file when booting
CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
5. Copy the startup script
CP Support-files/mysql.server/etc/init.d/mysqld
6. Edit the startup script
Vim/etc/init.d/mysqld
Locate Basedir and DataDir to change the content as follows:
Basedir=/usr/local/mysql
Datadir=/usr/local/data/mysqldata
7. Change the startup script configuration file to 755
chmod 755/etc/init.d/mysqld
8. Add Mysqld to start
Chkconfig--add mysqld
9. Start MySQL
1>. To start MySQL with a command:
Service mysqld Start
Starting MySQL ....... success!
2>. Start with a script
/etc/init.d/mysqld start
10. Stop MySQL
Service Mysqld Stop
Shutting down MySQL. success!
11. Start the script as a command line,--defaults-file specify the configuration file, specify the user, specify the directory, add the & symbol, and put it in the background to execute
/usr/local/mysql/bin/mysqld_safe--defaults-file=/etc/my.cnf--user=mysql--datadir=/data/mysql &
12. The MySQL script that starts in the command line cannot be stopped directly, can stop the service using Killall
Using Killall stops the current write operation, writes data that is not written to the disk, and then kills the process after it is finished.
If you encounter the process of MySQL kill, it may indicate a large amount of data, slowly write to disk, this time do not use kill-9 force kill process, may corrupt data.
Killall mysqld
(Problem: If missing Perl-related modules are found, the fatal error:please install the following Perl modules before executing/usr/bin/mysql_install_db :
Data::D umper) Other questions see http://www.jb51.net/article/97103.htm
If ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes) resets password resolution
Easy steps:

Generally this error is caused by a password error, the solution is to reset the password.

Let's say we're using the root account.

1. The first step in resetting the password is to skip the MySQL password authentication process, as follows:

#vim/etc/my.cnf (Note: My.ini is modified under Windows)

Search within a document MYSQLD navigate to the [mysqld] text segment:
/mysqld (enter the command directly in the Vim edit state to search for text content)

Add "skip-grant-tables" to skip password verification on any line following [Mysqld], as shown in:

Save the document and exit:

#:wq
2. Next we need to restart MySQL:

/etc/init.d/mysql Restart (some users may need to use/etc/init.d/mysqld restart)

3. After rebooting, enter #mysql to enter MySQL.

4. The next step is to use SQL to modify the root password

mysql> use MySQL;
mysql> Update user Set Password=password ("Your new password") where user= "root";
mysql> flush Privileges;
Mysql> quit

The root account has been reset to the new password.

5. Edit the my.cnf, remove the content you just added, and then restart MySQL. Done!

There are a lot of solutions to this problem on the Internet, many of the friends who have just contacted may be confused to find my.cnf or My.ini files on their own platform, if you are Linux, you can search by using the following methods:

As for the Windows platform, go to the installation directory and look for My.ini.

MySQL installation linux_ binary package installation

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.