允许远程访问
Eagle@Eagle:~$ sudo -i
root@Eagle:~# cd /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin
root@Eagle:~# ./mysql -u root -p
MariaDB [(none)]> show databases;
MariaDB [(none)]> use mysql;
MariaDB [mysql]> select User,host from mysql.user;
MariaDB [mysql]> update user set host="%" where user="root" and host="localhost";
MariaDB [mysql]> select User,host from mysql.user;
MariaDB [mysql]> FLUSH PRIVILEGES;
定时备份数据库
https://w.cnblogs.com/letcafe/p/mysqlautodump.html
优化
查找是否存在记录时,使用 limit
SELECT 1 FROM table WHERE a = 1 AND b = 2 LIMIT 1
查重:https://mp.weixin.qq.com/s/CZMgpHriQFmuTuwULsE9Ag