MySQL 基础
MySQL 基础
MySQL Install on MacOS
$ cd mysql-master
# Init the data dir first
# bin/mysqld --defaults-file=./my.cnf --initialize --user=mysql
$ bin/mysqld --initialize --user=mysql
A temporary password is generated for root@localhost: r_/(wD0p3;Im
# bin/mysqld --defaults-file=/etc/my.cnf &
$ bin/mysqld --defaults-file=/etc/my.cnf
# test Server
$ bin/mysqladmin -S /var/run/mysqld/mysqld.sock -u root -p version
$ bin/mysqladmin -S /var/run/mysqld/mysqld.sock -u root -p shutdown
$ bin/mysqlshow -S /var/run/mysqld/mysqld.sock -u root -p
$ bin/mysqlshow -S /var/run/mysqld/mysqld.sock -u root -p mysql
$ bin/mysql --defaults-file=/etc/my.cnf -u root -p -e "select host, user from user" mysql
# Another terminal
$ bin/mysql -S /var/run/mysqld/mysqld.sock -P 3308 -u root -p
# alter user root@'127.0.0.1' IDENTIFIED WITH caching_sha2_password BY '123456';
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
mysql> CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root-password';
mysql> CREATE USER 'root'@'::1' IDENTIFIED BY 'root-password';主从同步配置
MySQL 特性
字符集与比较规则
MySQL 物理表
最后更新于