标签:
/usr/local/mysql/bin/mysql -uroot -h 127.0.0.1
/usr/local/mysql/bin/mysqladmin -uroot password ‘aminglinux.com‘
/usr/local/mysql/bin/mysqladmin -uroot -paminglinux.com password ‘AmingLinux‘
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin
/etc/bashrc
vim /etc/profile.d/path.sh
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile.d/path.sh
mysql -uroot -pAminglinux -h 127.0.0.1 -P3306
mysql -uroot -S /tmp/mysql.sock -pAmingLinux
show databases
use db;show tables;
desc tb;
show create table tb;
select user();
select database();
create database db1;
create table t1(‘id‘ int(4),‘name‘ char(40));
insert into tb1 (id,name) values(1,‘aming‘);
select version();
show status;
>show variables like ‘max_connect%‘;
>set global max_connect_errors = 1000;
>show processlist;
show variable like ‘max_connect%‘;
grant all on *.* to user1 identified by ‘123456‘;
grank all on db1.* to ‘user2‘@‘10.0.2.100‘ identified by ‘111222‘;
grank all on db1.* ‘user3‘@‘%‘ identified by ‘231222‘;
UPDATE mysql.user SET password=PASSWORD("newpwd") WHERE user=‘username‘;
select count(*)from mysql.user
select * from mysql.db;select * from mysql.db where host like ‘10.0.%‘;
update db1.t1 set name=‘aaa‘where id=1;
truncate table db1.t1;
drop table db1.t1
drop database db1;
repair table tb1 [use frm];
mysql -uroot -pAmingLinux mysql -e "show tables‘
标签:
原文地址:http://www.cnblogs.com/FlameLuo/p/5634013.html