1、更改表名:alter table tablename rename newname;
2、增加字段:alter table tablename add itemname varchar(255);
3、更改字段:alter table s_t_101001 modify Nums6 int(20) NOT NULL;
4、跳过密码登陆
# vi /etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
保存并且退出vi。
5、导出表:mysqldump -uroot -p dbname tablename >filename.sql
6、mysql连接权限
Grant all privileges on *.* to 'root' @'192.168.1.1' identified by 'password' with grant option;
Grant all privileges on *.* to 'root' @'%' identified by 'password' with grant option;
flush privileges;
2、增加字段:alter table tablename add itemname varchar(255);
3、更改字段:alter table s_t_101001 modify Nums6 int(20) NOT NULL;
4、跳过密码登陆
# vi /etc/my.cnf
在[mysqld]的段中加上一句:skip-grant-tables
例如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
保存并且退出vi。
5、导出表:mysqldump -uroot -p dbname tablename >filename.sql
6、mysql连接权限
Grant all privileges on *.* to 'root' @'192.168.1.1' identified by 'password' with grant option;
Grant all privileges on *.* to 'root' @'%' identified by 'password' with grant option;
flush privileges;