存档

‘MySQL’ 分类的存档

由于主服务器异外重启, 导致从报错, 错误如下:

show slave status错误:

mysql> show slave status\G

阅读全文——共2991字

612 views | 1 条评论
十 12th, 2011 | Filed under MySQL

MySQL跨时区迁移数据的解决方法,重要!

问: 如果数据表中有时间字段,现在要迁移到其他时区的服务器上,该如何处理呢?

答:在高版本的mysqldump中,新增了一个选项:–tz-utc,默认是启用的,来看看它的说明

阅读全文——共726字

668 views | 没有评论
五 15th, 2010 | Filed under MySQL
标签: ,

#BEGIN CONFIG INFO

#DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大

#TYPE: SYSTEM

阅读全文——共9093字

1,052 views | 2 条评论
四 20th, 2010 | Filed under MySQL
标签: ,

mysql使用普通用户备份出现:

[root@centos ~]# mysqldump -h 192.168.4.28 -uuser_intra -ppassword HR > 1.sql

mysqldump: Got error: 1045: Access denied for user ‘user_intra’@’192.168.4.225′

阅读全文——共381字

3,596 views | 没有评论
五 28th, 2009 | Filed under MySQL

#!/bin/sh
#Mysql start|stop|restart
#Created by ritto
#20081120

mysql_port=$2
mysql_username=“root”
mysql_password=“123456″
mysql_port=“3306″

526 views | 没有评论
十二 19th, 2008 | Filed under MySQL
标签:

平时进入MySQL时总要输入很长的命令,把MySQL的路径加入到默认的环境变量中去以后就很方便了。

export PATH=$PATH:/usr/local/mysql/bin     //临时修改的

若要永久生效
echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile  //永久修改的
source /etc/profile

800 views | 没有评论
十二 16th, 2008 | Filed under MySQL

转载于我同事David.Yang写的 MySQL主从复制一文,再稍做修改的,原文地址http://blog.chinaunix.net/u/29134/showart_1711722.html

All the info below should be added in /etc/my.cnf. If you can’t find this file, just use the following statements to find where it is.

  1. To find the location of my.cnf.

ps -ef | grep mysql | grep -v ‘grep’ | head -1

For example .
[root@ritto /]# ps -ef | grep mysql | grep -v ‘grep’ | head -n 1

root      2776  2494  0 03:47 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe –defaults-file=/usr/local/mysql/my.cnf

675 views | 没有评论
十二 14th, 2008 | Filed under MySQL

1.登陆mysql
[root@ritto /]# /usr/local/mysql/bin/mysql -u root -p
Enter password:

<1>.创建用户
mysql> insert into mysql.user(host,user,password) values(‘%’,'ritto’,password(’123456′));
//刷新系统权限表
mysql> flush privileges;
确切地说这是在增加一个用户,用户名为ritto,密码为123456。注意要使用PASSWORD函数,然后还要使用FLUSH PRIVILEGES来执行确认。

705 views | 没有评论
十 8th, 2008 | Filed under MySQL
标签:

  论坛MySQL数据库的一张MySQL表损坏。根据经验,成功修复MySQL损坏表的概率是90%,没有必要去用旧的数据库备份去恢复。  方法很简单,四步即可搞定。 
 ①、用root帐号从命令行登录MySQL:  mysql -u root -p 
 ②、输入root帐号的密码。 
 ③、选定数据库名(本例中的数据库名为studentmis):  use studentmis;  
    ④、修复损坏的表(本例中要修复的表为smis_user_student):
  repair table smis_user_student;

933 views | 1 条评论
八 8th, 2008 | Filed under MySQL
标签: