您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Mysql下载&安装与配置

bubuko 2022/1/25 19:59:46 mysql 字数 1868 阅读 619 来源 http://www.bubuko.com/infolist-5-1.html

1、Windows版本下载地址 https://www.mysql.com/downloads/ 2、拷贝到存放路径解压即用 3、修改精简文件名 4、修改环境变量 将mysql路径添加到path下的环境变量(用;分割) 5、用管理员模式打开cmd.exe,通过cd命令切换到mysql路径(Windo ...

1、Windows版本下载地址

https://www.mysql.com/downloads/

2、拷贝到存放路径解压即用

3、修改精简文件名

4、修改环境变量

将mysql路径添加到path下的环境变量(用;分割)

5、用管理员模式打开cmd.exe,通过cd命令切换到mysql路径(Windows下要加\d)

6、创建my.ini修改配置,设置默认账号、默认密码及识别的字符编码。

#mysql5.5以上:修改方式有所改动

[mysqld] character-set-server=utf8 collation-server=utf8_general_ci [client] default-character-set=utf8 user=‘root‘ password=‘‘ [mysql] default-character-set=utf8 user=‘root‘ password=‘‘

7、输入mysqld.exe --install,直接启动服务

8、进入services.msc找到MySQL启动服务

 

破解密码登录

windows系统

#1 关闭mysql
#2 在cmd中执行:mysqld --skip-grant-tables
#3 在cmd中执行:mysql
#4 执行如下sql:
update mysql.user set authentication_string=password(‘‘) where user = ‘root‘;
flush privileges;

#5 tskill mysqld #或taskkill -f /PID 7832
#6 重新启动mysql

linux系统
[root@egon ~]# vim /etc/my.cnf    #mysql主配置文件
[mysqld]
skip-grant-table
[root@egon ~]# systemctl restart mariadb
[root@egon ~]# mysql
MariaDB [(none)]> update mysql.user set password=password("123") where user="root" and host="localhost";
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> \q
[root@egon ~]# #打开/etc/my.cnf去掉skip-grant-table,然后重启
[root@egon ~]# systemctl restart mariadb
[root@egon ~]# mysql -u root -p123 #以新密码登录

 *****修改sql_mode模式*****

默认模式为非严格模式,对于某些不符合限制的内容系统不会报错,会自行处理。

严格模式在遇到不符合限制条件的语句会报错。

修改sql_mode为严格模式,必须重启客户端才能生效。
set global sql_mode="strict_trans_tables";
select @@sql_mode;

Mysql下载&安装与配置

原文:https://www.cnblogs.com/chriszun/p/12642975.html


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶