Home >Database >Mysql Tutorial >Summary of common problems with mysql during development

Summary of common problems with mysql during development

藏色散人
藏色散人forward
2020-04-10 13:19:362516browse

Record the mysql-related problems encountered during the development process and their solutions, and update them in the long term.

Remote connection problem

Mysql default connection can only be given to the local (localhost or 127.0.0.1). If you want a certain IP address to access mysql, you need to open it manually. This permission

Method:

● Enter the terminal

● Assign a new user

grant all privileges on *.* to '用户名'@'IP地址' identified by '密码';

● Refresh permissions

flush privileges;

If you want to use LAN All machines can connect to the mysql database and execute the following command

grant all privileges on *.* to '用户名'@'%' identified by '密码' with grant option;

● all privileges refers to all permissions, and can also be written as select, utdate, etc.

● *.*refers to all tables in the database

● IP address: IP address allowed to connect, % is allowed for all machines in the LAN

Reserved word problem

MySQL reserved words like index , should be avoided as much as possible in development. If index is used, then the sql should be processed through back single quotes `` (the key below Esc)

Table case issue

Mysql does not distinguish the case of table names under the Windows system, but mysql indicates that it is case-sensitive under the Linux system. In Linux, make mysql case-insensitive:

● Log in as root and modify /etc/my.cnf

● Add a line under [mysqld]: lower_case_table_names=1

● Restart mysql

Recommendation: "mysql video tutorial"

The above is the detailed content of Summary of common problems with mysql during development. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete