Mysql Commands

start service: mysqld --console;mysql

start client: mysql -uroot -proot;sql

check server version: show variables like '%version%';ide

check status: status or show veriables like '%char%';ui

change charset:spa

  SET character_set_client='utf8';
  SET character_set_connection='utf8';
  SET character_set_results='utf8';server

run sql script: source file_name;ip

create user: it

  CREATE USER quickcom@'localhost' IDENTIFIED BY 'dev';
  CREATE USER userRemote@'%' IDENTIFIED BY 'test';io

grant: grant select,insert,update,delete on kuaikua.* to quickcom@'localhost' identified by 'dev';console

delete database: drop database db_name;

database export: 

  export db schema: mysqldump -h[host] -u[user] -p[password] -d db_name > script_name.sql;
  export db.table schema: mysqldump -h[host] -u[user] -p[password] -d db_name table_name > script_name.sql;

  export db schema with data: mysqldump -h[host] -u[user] -p[password] db_name > script_name.sql;
  export db.table schema with data: mysqldump -h[host] -u[user] -p[password] db_name table_name > script_name.sql;

相關文章
相關標籤/搜索