Mysql configuration in Linux

Source: Internet
Author: User

After installing Mysql in Linux, You need to perform some configuration.

Modify/etc/my. cnf as needed. Refer to the Configuration:
[Mysqld]
# Set the default value to the INNODB table, which supports transactions and row locks:
Default-storage-engine = INNODB
# Set the default character set:
Default-character-set = utf8
# Maximum buffer size used for client communication
Max_allowed_packet = 16 M

Start MySQL:
Service mysql start
/Etc/init. d/mysql start
/Usr/share/mysql. server start

[Mysql. server]
# Comment out the basedir line; otherwise, MySql may not be able to start
# It is said to be a MySql bug
# Basedir =/var/lib

Enable the MySQL system to start automatically:
Check MySql in system Settings> Server Settings> service.
When the root user logs on, mysql is automatically started:
Add one line to the/root/. bash_profile file:
/Usr/share/mysql. server start

View the startup log:
/Var/log/messages

Show all MySQL users:
Use mysql;
Select host, user, password from user;

Add a MySQL user (user name: user1, password: SQL ):
Grant all on *. * to user1 @ '%' identified by 'SQL' with grant option;

Delete a MySQL user:
Delete from user where user = 'user1 ';

Eg: My machine configuration
[Client]
Port = 3306
Socket =/var/lib/mysql. sock
Default-character-set = utf8
[Mysqld]
Datadir =/var/lib/mysql
Socket =/var/lib/mysql. sock
User = mysql
Default-character-set = utf8

# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1

[Mysqld_safe]
Log-error =/var/log/mysqld. log
Pid-file =/var/run/mysqld. pid
Default-character-set = utf8

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.