mysql配置文件 my.ini

[mysqld]
basedir ="D:\mysql-8.0.16-winx64\mysql-8.0.16-winx64"
datadir ="D:\mysql-8.0.16-winx64\mysql-8.0.16-winx64\data"
max_connections=200
max_connect_errors=20
port=3333
server_id =10
character-set-server=utf8
character_set_filesystem=utf8
skip-grant-tables  //跳过密码验证,需要修改root密码时可以先加上
shared-memory
[client]
port=3333
default-character-set=utf8
[mysqld_safe]
timezone="CST"
[mysql]
default-character-set=utf8

常见错误:

MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。

用命令 mysqld --console  把错误信息打印到控制台,查看错误信息找对应的解决方法。实例:

2018-10-17T12:35:16.437782Z 0 [ERROR] Can’t start server: Bind on TCP/IP port: No such file or directory
2018-10-17T12:35:16.437782Z 0 [ERROR] Can’t start server: Bind on TCP/IP port: No such file or directory
2018-10-17T12:35:16.439025Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2018-10-17T12:35:16.450300Z 0 [ERROR] Aborting

TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS 解决方法:

my.ini文件添加行:

shared-memory(如上文件添加)

添加到mysqld里

 

ps 设置密码:

1、重启mysql服务

2、mysql -u root 

3、alter user 'root'@'localhost' identified by '123456';

 

你可能感兴趣的:(数据库)