Related configuration of mysql in linux _ MySQL

Source: Internet
Author: User
Install mysql in mysql configuration in linux: apt-get install mysql-server


Set the root permission for mysql remote connection:
1. modify the/etc/mysql/my. cnf file and find bind_address = 127.0.0.1 and comment it out.
2. restart the mysql service.
3. log on to mysql-u root-p

4. mysql> Grant all privileges on *. * to "root" @ "%" identified"Password"With grant option;

5. mysql> flush privileges; // The modification takes effect.

The command in step 4 is explained as follows, *. *: the first * indicates the database name, and the second * indicates the table name. This means that all tables in all databases are authorized to users. Root: Grant the root account. "%": Indicates that the authorized user's IP address can be specified. This indicates that any IP address can access the MySQL database. "Password": password corresponding to the allocated account. replace the password with your mysql root account password.

The fifth step is to refresh the permission information, that is, to make the settings take effect immediately.

Set mysql encoding:

Modify the/etc/mysql/my. cnf file,

Find[Client]Add:
Default-character-set = utf8 // the default character set is utf8

Find[Mysqld]Add:
Default-character-set = utf8 // the default character set is utf8
Init_connect = 'set NAMES utf8' // sets utf8 encoding for connecting to the mysql database to run utf8 for the mysql database.

After modification, restart mysql.



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.