mysql 8.0.19 winx64.zip安装教程
本文记录了mysql 8.0.19 winx64.zip安装教程,供大家参考
新建 my.ini文件
?1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | [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. # 设置mysql数据库的数据的存放目录 basedir=E:\app\mysql-8.0.19-winx64 datadir=E:\app\mysql-8.0.19-winx64\data #设置3306端口 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 # 服务端使用的字符集默认为UTF8 character - set -server = utf8mb4 performance_schema_max_table_instances = 600 table_definition_cache = 400 table_open_cache = 256 # 创建新表时将使用的默认存储引擎 default -storage-engine=INNODB #最大连接数 max_connections=200 [mysql] default - character - set = utf8mb4 [client] default - character - set = utf8mb4 |
初始化密码查找:
如果data文件夹已经存在,先删除后,再执行以下:
?1 | mysqld --initialize --console |
可以看到控制台输出有以下:
A temporary password is generated for root@localhost: hjd/Qg=XN4D*
在安装目录下生成 data文件 不用自己创建。
执行 mysqld -install 安装mysql数据库
(如果不用管理员身份运行,将会因为权限不够而出现错误:Install/Remove of the Service Denied!)
执行时一定要在bin目录底下(或者把bin层级的路径添加到path环境变量中)
net start mysql 启动服务(需要管理员权限)
net stop mysql 关闭服务。
启动成功以后
输入 mysql -u root -p
Enter password: --------------上述临时密码
直接回车就行
接下来设置自己的密码
set password=“你的密码”
查看一下默认安装的数据库
?1 | show databases; |
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/mable_Marble/article/details/104114572
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。