摘要:时间戳转换datetime转换为时间戳:UNIX_TIMESTAMP()时间戳转换为datetime:FROM_UNIXTIME()mysql> create table testtime(id int auto_increment not null,timestr int,PRIMARY KEY(...
阅读全文
摘要:mysql> explain select actor.first_name,actor.last_name,count(*) from sakila.film_actor inner join sakila.actor using(actor_id) group by film_actor.ac...
阅读全文
摘要:mysql> select * from t where t.id in (select t1.tid from t1);+------+| id |+------+| 1 |+------+1 row in set (0.00 sec)mysql> select t.id from t ...
阅读全文
摘要:mysql> explain select customer_id,first_name,last_name from customer;+----+-------------+----------+------+---------------+------+---------+------+---...
阅读全文
摘要:下载地址,选择相应的版本来进行安装测试http://dev.mysql.com/doc/index-other.html相关说明http://dev.mysql.com/doc/sakila/en/sakila-installation.htmloutous-MacBook-Pro:~ wangta...
阅读全文
摘要:数据库是Web大多数应用开发的基础。如果你是用PHP,那么大多数据库用的是MySQL也是LAMP架构的重要部分。PHP看起来很简单,一个初学者也可以几个小时内就能开始写函数了。但是建立一个稳定、可靠的数据库确需要时间和经验。下面就是一些这样的经验,不仅仅是MYSQL,其他数据库也一样可以参考。 1...
阅读全文
摘要:http://www.percona.com/blog/
阅读全文
摘要:查看MYSQL数据库中所有用户mysql>SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;+---------------------------------------+| qu...
阅读全文
摘要:mysql的数据文件夹里出现mysql-bin日志文件,通过my.cnf注释掉log后,是否可以删除了?参考http://database.51cto.com/art/201107/278988.htm详细介绍mysql-bin.000001文件的来源及处理方法在MySQL数据库中,mysql-bi...
阅读全文
摘要:安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE),这个错误搞得很郁闷,仔细分析之后,知道这个报错和密码有关,可能是密码在...
阅读全文
摘要:use msyql;update user set password=password('新密码') where user='root';flush privileges;quitnet stop mysql#如果提示 发生系统错误5,就用管理员身份启动cmd.exe
阅读全文
摘要:原来一直是使用MySQL安装版没有出现过问题,今天在安装绿色版MySQL时出现了点问题在安装成windows服务成功后,用net start mysql 启动时提示启动成功,但当我连接mysql就报以下错误:ERROR 2003 (HY000): Can't connect to MySQL ser...
阅读全文
摘要:删除整个表TRUNCATE TABLE 表名;持久链接自动提交
阅读全文