MySQL configuration file path under LAMPP:
/opt/lampp/etc/my.cnf
1 Configuring the default character Set
Added under Mysqld
Character-set-server=utf-8
Init_connect = ' SET NAMES UTF8 '
Add under Client
Default-character-set =utf8
Jiangzi OK, try to use the JetBrains Data Connection tool insert a Chinese data try it, see if you can insert Chinese UTF8 character data normally
2 Modifying the default allowed execution of the largest SQL script size
Why should I set this project?
If you have a SQL script that is larger than the default value, it will not be able to execute anymore.
The same my.cnf.
Items: Under Mysqld and Mysqldump
max_allowed_packet=500m
Settings can
3 Migrating the default database folder path
Just loaded LAMPP mysql its path is under/OPT, which is the system folder, we need to migrate it to the specified private database folder
Copy the default folder first
sudo cp-rp/opt/var/mysql/home/mysqldata
Then modify the settings in the MY.CNF
Client Item Sock Link file
Sock=/home/mysqldata/mysql.sock
MYSQLD Item Sock Link file
Sock=/home/mysqldata/mysql.sock
Add a Data folder variable to the next row in the Plugin_dir variable
Datadir=/home/mysqldata
Complete database document path migration;
4 build linux MySQL client link command configuration
sudo apt-get install-y mysql-client-core-5.5
Install the sock link after the configuration.
Delete the original system mysql command path
sudo rm-rf/var/run/mysqld
Rebuilding folders
sudo mkdir/var/run/mysqld
Rebuilding a soft connection
sudo ln-s/home/mysqldata/mysql.sock/var/run/mysqld/mysqld.sock
Then try the MySQL command directly under the command line.
5 Set InnoDB shared file index Table self-increment space
If not set, will also cause a variety of inexplicable ibdata1 start error
MY.CNF settings
Innodb_data_home_dir=/home/mysqldata
innodb_data_file_path=ibdata1:5000m;ibdata2:5000m;ibdata3:1000m;ibdata4:1000m:autoextend:max:5000m
This means that each time the self-increment table space 1000M, but the maximum value is 5000M, can be set according to their actual disk space, the lowest value is best not to use the default 10M or the actual production environment used easily fail
It's over here.
Welcome to reprint and attach original Thank you