https://dev.mysql.com/downloads/mysql/
- 表的自增字段支持21亿,bigint更大,溢出会出错
- 状态,类型,男女尽量使用tinyint smallint,不推荐使用枚举类型
- IP推荐int 不推荐char(15)
- 索引不超过5个字段
TiDB集群,适用于5000万以上
https://pingcap.com/
apt install mariadb-server mariadb-client
sudo apt-get remove mysql-server mysql-client
命令如下,登录ssh
mysql -u root -h localhost -p
use mysql
update user set host='%' where user='root' and host='localhost';//所有机器可连接
update user set host='106.39.178.131' where user='root' and host='localhost';//指定ip可连接
GRANT ALL PRIVILEGES ON *.* TO '用户'@'%'IDENTIFIED BY '密码' WITH GRANT OPTION; 指定用户可远程连接
flush privileges;
修改默认密码 mysql_secure_installation
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
配置文件中的[mysqld]这一块中加入skip-grant-tables
bind-address,把127.0.0.1 改为0.0.0.0
service mysql restart
use mysql;
update user set authentication_string=password(“123456”) where user=”root”;
flush privileges;
mysql -u root -p
作者:Yoby 创建时间:2020-07-22 21:03
更新时间:2024-12-05 13:26
更新时间:2024-12-05 13:26