一个 mysql server 上的小技巧
转自http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
在my.cnf 的 mysql 端 添加如下设置
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
会产生如下效果:
root@ubuntu:/home/hew# mysql -u hew -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 320
Server version: 5.1.41-3ubuntu12.1 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
(hew:mysql1@linuxbyte.org 21:12)[(none)]: use linuxbyte #注意这里
Database changed
(hew:mysql1@linuxbyte.org 21:13)[linuxbyte]: use linuxsky; #这里
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
(hew:mysql1@linuxbyte.org 21:13)[linuxsky]: #这里
如上所示我们可以在mysql命令行下显示当前的mysql 用户,所在主机,时间和所用的数据库。
这个在关键时刻可以让我们避免很多误操作。
相关文档:
方法一
使用phpmyadmin,这是最简单的了,修改mysql库的user表,不过别忘了使用PASSWORD函数。
方法二
使用mysqladmin,这是前面声明的一个特例。
mysqladmin -u root -p password mypasswd
输入这个命令后,需要输入root的原密码,然后root的密码将改为mypasswd。
把命令里的root改为你的用户名,你就可以改你 ......
*************************字符串函数***********************************
mysql> select concat('aa','bb');//字符串的连接
mysql> select insert ('beijing2008you',12,3,'me');//字符串的插入
+-------------------------------------+
| insert ('beijing2008you',12,3,'me') |
+----------------------- ......
卸载MySQL数据库:
先停掉WINDOWS里的MySQL服务;
用360安全卫士强行删除MySQL数据库
接着在注册表里清除MySQL服务:
1、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 目录删除
2、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 目录删除
3、HKEY_ ......
版权声明
:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://bbayou.blogbus.com/logs/37045617.html
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET
SESSION
BULK_INSERT_BUFFER_S ......