安装mysql
1
| mysql_secure_installation
|
创建数据库,授权用户
输入刚才设置的密码
1
| create database db_name character set utf8mb4;
|
1
| create user 'username'@'%' identified by 'password';
|
1 2
| grant all privileges on db_name.* to 'username'@'%'; flush privileges;
|
命令行免密码登录
1 2 3 4 5 6
| [client] host = 127.0.0.1 user = ******* password = ******* port = 3306 database = ******
|
1
| brew services restart mysql
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| ➜ ~ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 20 Server version: 8.0.19 Homebrew
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
|