Quantcast
Channel: 码农网 » MySQL
Browsing latest articles
Browse All 11 View Live

MySQL主从复制(Master-Slave)与读写分离(MySQL-Proxy)实践

转载自:http://heylinux.com/ 查看原文 Mysql作为目前世界上使用最广泛的免费数据库,相信所有从事系统运维的工程师都一定接触过。但在实际的生产环境中,由单台Mysql作为独立的数据库是完全不能满足实际需求的,无论是在安全性,高可用性以及高并发等各个方面。 因此,一般[......] Read more

View Article



Value ’0000-00-00 00:00:00′ can not be represented as java.sql.Timestamp

问题描述 有一个mysql数据库,其中一个表的字段为: (`date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'). 数据库中日期的默认值0000-00-00 00:00:00 java程序中抛出以下错误: ...'[......]Read more

View Article

sql语句优化

Optimizing SQL   Test Your Changes: Different databases handle SQL differently so it’s not possible to lay down hard and fast rules that app[......] Read more

View Article

sql 比较两个表中的数据

有两个表t_appinfo 和g_appinfo ,存储的信息基本一致,都包含package_name这个字段,现在需要查出package_name 存在于t_appinfo表,而且不存在于g_appinfo表的记录. 方法一:使用NOT EXISTS SELECT a.name,a.p[......] Read more

View Article

CommunicationsException: Communications link failure

http://forums.mysql.com/read.php?39,600125,600125 Java+mysql抛出以下异常的可能原因 CommunicationsException: Communications link failure If you get a SQL[......] Read more

View Article


mysql sql timestamp to date

mysql使用sql语句将时间戳转换成日期格式 表结构,及其相关sql如下: CREATE TABLE `mytable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `create_time` int(11) NOT NULL, P[......] Read more

View Article

查看mysql各个表占用的存储空间大小

http://stackoverflow.com/questions/9620198/how-to-get-the-sizes-of-the-tables-of-a-mysql-database You can use this query to show the size of a table:[......] Read more

View Article

mysql 根据日期和小时进行分组查询某天某个小时的记录数

订单数据记录在order(id,add_time,order_no,uid)中 add_time保存的是日期的字符串,类似:2014-11-11 11:01:12 下面查询201406每一天每个小时的订单数,按小时和天进行分组。 SELECT DATE(add_time) AS date[......] Read more

View Article


mysql备份shell脚本

mysql备份shell脚本 修改脚本中数据库名称,数据库用户名和密码,以及mysqldump工具的路径和备份数据存储目录即可。 db_backup.sh #!/bin/bash #global configurations dates=`date +%Y%m%d` the_db_nam[......] Read more

View Article


mysql查看sql语句执行历史记录

mysql查看sql语句执行历史记录 cat ~/.mysql_history 对于mysql版本5.1以后的版本,可以通过以下方式启动日志记录。能够记录下包括应用程序执行的sql语句。 MariaDB [(none)]> SET GLOBAL log_output = '[......] Read more

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images