MySQL 8.0.11的安装与配置

  上一篇介绍了JDK以及idea的安装和配置,这次是另一个比较重要的软件,MySQL 8.0.11的安装与配置,这个版本比较新,也是现在公司比较常见的软件。以下是我整理的详细安装与配置过程,本人亲测,已经成功。

解压压缩包到D:\mysql-8.0.11-winx64

创建my.ini,以下是my.ini的配置内容。

[mysqld]
default_authentication_plugin=mysql_native_password
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir=D:\mysql-8.0.11-winx64 //设置安装路径
datadir=D:\mysql-8.0.11-winx64\data //文件存放路径
port = 3306 //设置端口号
# server_id = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
character-set-server = utf8mb4
performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256
[mysql]
default-character-set = utf8mb4
[client]
default-character-set = utf8mb4


我的安装路径是D盘,以管理员身份打开CMD,输入下列命令
D:\mysql-8.0.11-winx64\bin>mysqld --initialize --console
得到本地数据库初始密码,密码要先记下来,下面就是输入的指令与效果。

D:\mysql-8.0.11-winx64\bin>mysqld --install
Service successfully installed.

D:\mysql-8.0.11-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

登陆mysql,这个地方就用到了前面记下的密码,初始密码比较乱,改一个好记的密码。
D:\mysql-8.0.11-winx64\bin>mysql -u root -p
Enter password: ************
密码必须要手敲,不能粘贴。
修改密码为123456
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

Query OK, 0 rows affected (0.07 sec)

需要可视化界面的可以安装sqlyog,支持很多种数据库。

猜你喜欢

转载自blog.csdn.net/dt_zhangshuo/article/details/81022042