Home >Database >Mysql Tutorial >What should I do if the mysql web side cannot be accessed?
The solution to the problem that the mysql web side cannot be accessed: first set the installation directory of mysql and set the storage directory of the data of the mysql database; then set the default character set of the mysql client; finally set the default character set when the mysql client connects to the server Just use the port.
Recommended: "mysql video tutorial"
mysql has been started locally, but cannot be accessed directly on the web page Solution
1. Modify the path code
# 设置mysql的安装目录 basedir=E:/Develop/mysql # 设置mysql数据库的数据的存放目录 datadir=E:/Develop/mysql/data
[mysqld] # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir=E:/Develop/mysql # 设置mysql数据库的数据的存放目录 datadir=E:/Develop/mysql/data # 允许最大连接数 max_connections=200 # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 max_connect_errors=10 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB # 默认使用“mysql_native_password”插件认证 default_authentication_plugin=mysql_native_password [mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [client] # 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8
in my.ini under the mysql file to:
# 设置mysql的安装目录 basedir=E:\Develop\mysql # 设置mysql数据库的数据的存放目录 datadir=E:\Develop\mysql\data
[mysqld] # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir=E:\Develop\mysql # 设置mysql数据库的数据的存放目录 datadir=E:\Develop\mysql\data # 允许最大连接数 max_connections=200 # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 max_connect_errors=10 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB # 默认使用“mysql_native_password”插件认证 default_authentication_plugin=mysql_native_password [mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [client] # 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8
Summary: Generally, modifying server files and configuration files can You should pay attention to the issue of slashes.
The above is the detailed content of What should I do if the mysql web side cannot be accessed?. For more information, please follow other related articles on the PHP Chinese website!