mysql 8.0.19 winx64.zip安装教程
程序员文章站
2022-07-09 13:53:11
本文记录了mysql 8.0.19 winx64.zip安装教程,供大家参考新建 my.ini文件[mysqld]default_authentication_plugin=mysql_native_...
本文记录了mysql 8.0.19 winx64.zip安装教程,供大家参考
新建 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. # 设置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文件夹已经存在,先删除后,再执行以下:
mysqld --initialize --console
可以看到控制台输出有以下:
a temporary password is generated for : 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=“你的密码”
查看一下默认安装的数据库
show databases;
精彩专题分享:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。