随笔分类 -  Mysql

摘要:原因:mysql8默认的使用密码认证方式不一样,mysql8.0默认使用caching_sha2_password,但是之前版本都是使用mysql_native_password 解决方案:将密码认证方式caching_sha2_password修改为mysql_native_password my 阅读全文
posted @ 2020-12-15 11:17 Ambtin 阅读(700) 评论(0) 推荐(0)
摘要:SQL结构化查询语言包含6个部分。SQL(Structure Query Language)语言是数据库的核心语言。 1).数据定义语言 DDL: Data Definition Language (隐形提交的,不用commit,不能rollback) 常用的有CREATE和DROP,用于在数据库中 阅读全文
posted @ 2020-12-09 17:32 Ambtin 阅读(383) 评论(0) 推荐(0)
摘要:Apache安装:https://www.cnblogs.com/Wtingting/p/13600695.htmlPHP安装:https://www.cnblogs.com/Wtingting/p/14040916.htmlMySQL安装:https://www.cnblogs.com/Wting 阅读全文
posted @ 2020-11-26 10:26 Ambtin 阅读(363) 评论(0) 推荐(0)
摘要:下载 https://www.mysql.com/downloads/1.以管理员身份打开命令行2.安装MySQL服务 cd C:\software\zdyhj\mysql-8.0.22-winx64\bin mysqld --install 3.初始化MySQL,产生一个随机密码 mysqld - 阅读全文
posted @ 2020-11-26 09:22 Ambtin 阅读(127) 评论(0) 推荐(0)
摘要:MySQL重启和查看状态 停止:service mysqld stop 开启:service mysqld start 重启:service mysqld restart 查看状态:service mysqld status 阅读全文
posted @ 2020-09-02 10:59 Ambtin 阅读(259) 评论(0) 推荐(0)
摘要:当查询出来的字符乱码时。 方法1:查询前设置 mysql> show variables like'%char%'; + + +| Variable_name | Value |+ + +| character_set_client | latin1 || character_set_connect 阅读全文
posted @ 2020-09-02 10:56 Ambtin 阅读(534) 评论(0) 推荐(0)
摘要:1、修改表字段类型 alter table users_log modify column code smallint(4); 2、增加表字段 alter table users_log add error_code mediumint(5); ALTER TABLE 表明 add 字段名称 类型( 阅读全文
posted @ 2020-08-05 16:56 Ambtin 阅读(494) 评论(0) 推荐(0)
摘要:binary:强制区分大小写 regexp:正则匹配 例:查询表users中username字段中存在大写字母的个数 select count(*) from users where binary username regexp '[A-Z]'; 阅读全文
posted @ 2020-08-05 16:51 Ambtin 阅读(370) 评论(0) 推荐(0)
摘要:CONCAT(str1, str2):字符连接函数 UPPER(str):将字符串改为大写字母 LOWER(str):将字符串改为小写字母 LENGTH(str):判定字符串长度 SUBSTRING(str, a, b):提取字段中的一段,从字符串str的第a位开始提取,提取b个字符 LEFT(st 阅读全文
posted @ 2020-08-05 16:41 Ambtin 阅读(2872) 评论(0) 推荐(0)