随笔分类 - Mysql
摘要:最近想尝试下新版本的Mysql 5.7.10,于是开始尝试玩下。在该次安装中,使用源码编译安装Mysql,编译器使用cmake。这里选择的版本是mysql-5.7.10,cmake的版本是cmake-2.8.10.2注:在下载源码包的时候,请注意选择Platform为“Source Code”。环境...
阅读全文
摘要:我们都知道Mysql中的User的meta data是存放到Mysql.User表中,但是很遗憾,其中提供的信息较少,比如我们无法得知某个User的具体创建时间。我们可以使用下面的方法来达到该目的。首先,我们向Mysql.User表中新增一个列,该列的作用是用来记录User的创建时间,同时赋予默认值...
阅读全文
摘要:假如表中包含一列为auto_increment,如果是Myisam类型的引擎,那么在删除了最新一笔数据,无论是否重启Mysql,下一次插入之后仍然会使用上次删除的最大ID+1.mysql> create table test_myisam (id int not null auto_incremen...
阅读全文
摘要:----修改数据库字符集的一个原则是:新的字符集包含的字库要>=原有的字符集字库,否则已经存在的数据可能会变为乱码。如果数据库中暂时还没有数据,那么我们可以直接执行命令。假如此时数据库中有表,那么表的字符集是不会随着数据库的字符集更改而更改的。alter database dbname charac...
阅读全文
摘要:Mysql的event schedule可以让你设置你的mysql数据库在某个时间段执行你想要的动作create event test1on schedule every 1 daystarts '2007-09-01 12:00:00'on completion not preservedo in...
阅读全文
摘要:1.Insert Set语句mysql> create table wison_test1(id int,name varchar(10));Query OK, 0 rows affected (0.10 sec)mysql> insert into wison_test1 set id=1,nam...
阅读全文
摘要:Mysql常用命令:--在Mysql中,语句的结尾要么使用;要么使用\g或者\G作为结束符。进入Mysql (---其中Your MySQL connection id is 5表示到当前为止连接到Mysql数据库的次数,Server version: 5.5.37-log Source dist...
阅读全文
摘要:之前有使用yum安装Mysql,执行过程比较简单。今天尝试使用源码编译的方式来安装Mysql。编译器使用cmake。选择的Mysql版本为:mysql-5.5.37,cmake的版本是cmake-2.8.10.2下载地址是:http://mysql.mirror.kangaroot.net/Down...
阅读全文
摘要:1.环境:E3DDBA11:172.16.13.111 --SlaveE3DDBA12:172.16.13.112 --MasterMysql版本均为mysql Ver 14.14 Distrib 5.1.61, for redhat-linux-gnu (x86_64) using readline 5.1[wh42@e3ddba11 etc]$ uname -aLinux e3ddba11 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux[wh42@e3dd...
阅读全文
摘要:环境:[wh42@e3ddba14 ABS_CORP]$ cat /etc/redhat-releaseCentOS release 6.3 (Final)[wh42@e3ddba14 ABS_CORP]$ uname -aLinux e3ddba14 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux--安装Mysql:首先准备好mysql group和user[wh42@e3ddba12 ~]$ sudo groupadd mysqlgroupadd: cannot
阅读全文
摘要:根据操作系统版本,下载对应版本的xtrabackup tar包。注:选择版本时,不一定要选择最新的。---要根据我们Mysql的版本选择对应的xtrabackup软件版本(我最开始选择的是2.1版本的xtrabackup,但是在执行的时候就有报错,所以最后才会选择到2.0.8版本的xtrabackupinnobackupex: Error: Support for MySQL 5.1 with builtin InnoDB (not the plugin) was removed in Percona XtraBackup 2.1. The last version to support My
阅读全文
摘要:使用yum安装mysql之后,一直无法进入mysql。一直报错access denied for user 'root'@'localhost'解决办法:进入bin目录,执行$ sudo service mysqld stop$ sudo mysqld_safe --user=mysql --skip-grant-tables --skip-networking $ mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD('newpassword') where USER=&#
阅读全文