mysql新增用户和登录
新增用户:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'你的远端ip' IDENTIFIED BY '你的密码' WITH GRANT OPTION;
如:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.19.220' IDENTIFIED BY '123456' WITH GRANT OPTION;
登录到新增的用户:(假如原授权机的IP为10.10.19.222)
mysql -uroot -p123456 -h10.10.19.222
相关文档:
To familiarize you with the basics, we will describe the simplest
possible configuration for a functional MySQL Cluster. After this,
you should be able to design your desired setup from the
information provided in the other relevant sections of this
chapter.
......
Administration 管理
Kill a Thread 结束一个线程
mysql > KILL 999;
Optimize Table 优化表
mysql > OPTIMEZE TABLE foo;
Reload Users Permissions 刷新MySQL系统权限相关表
mysql > FLUSH PRIVILEGES;
Repair Table 修复表
mysql > ......
MySQL Cluster配置step by step
来源:http://space.itpub.net/15415488/viewspace-620903
公司有个项目是测试distributed DB,其中一项是针对MySQL Cluster的测试。
于是花了两天时间装机器和配置MySQL Cluster。整个过程还是比较顺利的,当然如果对MySQL常用命令比较熟悉的话会更顺利。
留下step by step配 ......
返回来自于参数连结的字符串。如果任何参数是NULL,返回NULL。可以有超过2个的参数。一个数字参数被变换为等价的字符串形式。
mysql> select CONCAT('My', 'S', 'QL');
-> 'MySQL'
mysql> select CONCAT('My', NULL, 'QL');
-> NULL
mysql> select CONCAT(14.3);
-> '14.3'
如:update test set ......
一、CREATE TABLE 方法
整表复制 # create table 新表 select * from 旧表;
结构复制 # create table 新表 select * from 旧表 where 1<>1;
二、INSERT INTO 方法
得到建表语句 # show create table 旧表;
新建表
复制数据到新表 INSERT INTO new_table(col1,col2,...) (SELECT col1,col2,... from old_table); ......