码迷,mamicode.com
首页 > 数据库 > 详细

mysql

时间:2016-07-01 19:51:39      阅读:259      评论:0      收藏:0      [点我收藏+]

标签:

/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‘

 

mysql

标签:

原文地址:http://www.cnblogs.com/FlameLuo/p/5634013.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!