Mysql 8.0安装使用快速上手
2018-08-21 23:01
176 查看
Mysql 快速上手合集
Mysql 8.0.12:
1、解压zip
2、配置环境变量path,
3、配置my.ini
[mysqld] # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir=D:\\Soft\\mysql8.0 # 切记此处一定要用双斜杠\\,单斜杠我这里会出错,不过看别人的教程,有的是单斜杠。自己尝试吧 # 设置mysql数据库的数据的存放目录 datadir=D:\\Soft\\mysql8.0\\Data # 此处同上 # 允许最大连接数 max_connections=100 # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 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
4、进入mysql安装路径,然后输入
mysqld --console,随机生成root密码
qo=seuu;q7lV,启动成功则会显示以下提示:
[System] [MY-010116] [Server] D:\Soft\mysql8.0\bin\mysqld.exe (mysqld 8.0.12) starting as process 11596 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed. [System] [MY-010931] [Server] D:\Soft\mysql8.0\bin\mysqld.exe: ready for connections. Version: '8.0.12' socket: '' port: 3306 MySQL Community Server - GPL.
5、输入:
mysql -uroot -pqo=seuu;q7lV登录成功
6、输入
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
不改变临时密码运行sql语句会提示
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
7、创建用户
CREATE USER 'xxh'@'%' IDENTIFIED WITH mysql_native_password BY 'xxh123!@#';
8、查找用户
select Host,User,plugin,authentication_string from mysql.user;
9、#授权所有权限
GRANT ALL PRIVILEGES ON *.* TO 'xxh'@'%';
授权基本的查询修改权限,按需求设置
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'xxh'@'%';
查看用户权限
show grants for 'xxh'@'%';
关闭数据库
mysqladmin -uroot -proot shutdown阅读更多
相关文章推荐
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备(转载)
- 【mysql】Centos6.5使用yum安装mysql——快速上手必备
- Linux学习总结(4)——Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备(转)
- Centos6.5使用yum安装mysql——快速上手必备
- Centos6.5使用yum安装mysql——快速上手必备