Mysql相关指令
一、Mysql安装路径
1.配置了环境变量:which mysql
2.默认安装地址:/usr/local/bin
二、Mysql配置路径
/usr/local/mysql/bin/mysqld --verbose --help |grep -A 1 'Default options'
三、Mysql配置范例
[mysqld]
basedir=/usr/local/mysql
datadir=/app/mysql
port = 3306
server-id=1
pid-file=/app/mysql/mysql3306.pid
socket = /app/mysql/mysql.sock
log_error=/app/mysql/mysql.err
log-bin=mysql-bin
binlog_format=mixed
innodb-file-per-table=ON
skip_name_resolve=ON
lower_case_table_names=1
[lient]
socket = /app/mysql/mysql.sock
port = 3306
四、mysql启动
/usr/local/mysql/bin/mysqld_safe --datadir=/app/mysql --pid-file=/app/mysql/mysql3306.pid
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/app/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysq --log-error=/app/mysql/mysql.err --pid-file=/app/mysql/mysql3306.pid --socket=/app/mysql/mysql.sock --port=3306
五、查找各表信息条数
use information_schema;
select table_name,table_rows from tables where table_schema='usercenter_dev';
六、建表赋权
Create user 'newman'@'%' IDENTIFIED BY 'bfgaea20200901';
create database newman;
Grant all on newman.* to 'newman'@'%';
七、编码方式
show variables like 'char%'