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

Summary of common problems with mysql during development

藏色散人
Release: 2020-04-10 13:19:36
forward
2490 people have browsed it

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 '密码';
Copy after login

● Refresh permissions

flush privileges;
Copy after login

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;
Copy after login

● 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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template