MySQL for Linux installation

Source: Internet
Author: User

1. Install client and server side

Verify that MySQL is installed:

[Plain]View PlainCopy 
    1. Yum List installed mysql*
    2. Rpm-qa | grep mysql*

To see if you have an installation package:

[Plain]View PlainCopy 
    1. Yum List mysql*

To install the MySQL client:

[Plain]View PlainCopy 
    1. Yum install MySQL

To install the MySQL server side:

[Plain]View PlainCopy 
    1. Yum Install Mysql-server
    2. Yum Install Mysql-devel

2. Start and stop settings

Database Character Set settings
MySQL config file/etc/my.cnf add Default-character-set=utf8
To start the MySQL service:

[Plain]View PlainCopy 
    1. Service mysqld Start

or/etc/init.d/mysqld start.
Set boot up:

[Plain]View PlainCopy  
    1. Chkconfig-add mysqld

See if the boot setting is successful

[Plain]View PlainCopy 
    1. Chkconfig--list | grep mysql*

Mysqld 0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off
To stop the MySQL service:

[Plain]View PlainCopy 
    1. Service Mysqld Stop

3, login and forget to change the password

To create a root administrator:

[Plain]View PlainCopy 
    1. Mysqladmin-u Root Password 666666

Login:
Mysql-u root-p
If you forget your password, execute the following code

[Plain]View PlainCopy 
    1. Service Mysqld Stop
    2. Mysqld_safe--user=root--skip-grant-tables
    3. Mysql-u Root
    4. Use MySQL
    5. Update user set Password=password ("666666") where user= "root";
    6. Flush privileges;

4. Allow Remote access settings

Port number for open firewall
MySQL Add permission: The user table in the MySQL library has a new record of "%" and the user is "root".

[Plain]View PlainCopy 
    1. Use MySQL;
    2. UPDATE user SET ' Host ' = '% ' WHERE ' user ' = ' root ' LIMIT 1;
    3. Flush privileges;

% means all IP access is allowed


5. Several important directories of MySQL

(a) Database directory
/var/lib/mysql/
(b) configuration files
/usr/share/mysql (mysql.server command and configuration file)
(c) Related orders
/usr/bin (Mysqladmin mysqldump and other commands)
(d) Startup scripts
/etc/rc.d/init.d/(startup script file for MySQL directory)

MySQL for Linux 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.