标签 MySQL 下的文章

ERROR 1286 (42000): Unknown table engine ‘InnoDB’

I was getting the error “ERROR 1286 (42000): Unknown table engine ‘InnoDB’” when trying to create/alter tables with the InnoDB engine. You can check for this warning by issuing the create or alter statements and then running
show warnings;
in the same mysql client session.

Check if you have InnoDB support enabled:

mysql> show variables like 'have_innodb';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_innodb   | DISABLED   |
+---------------+-------+
1 row in set (0.04 sec)

The problem is that InnoDB is not enabled by default in Debian distributions of my.cnf. To enable it, simply comment the following lines under the [mysqld] section.

skip-innodb

via

DISABLED和NO是有区别的,DISABLED表示具有该功能,只是没有启用(通过启动参数or配置文件),NO表示彻底的不支持的编译版本。

MySQL版本: Alpha, Beta, Gamma, Production (Generally Available)

MySQL versions are identified by the attributes alpha, beta, gamma, and production:

Alpha means that the version is in the throes of the development process and that new functions and even incompatible changes are to be expected. Although an alpha version is not published until it contains no known errors, it is highly probable that many undiscovered errors still lurk within. Loss of data during testing of an alpha version is quite possible! Alpha versions are of interest only to developers who wish to try out the latest features of MySQL.

Beta means that this version is largely complete, but it has not been thoroughly tested. Major changes are not expected.

Gammameans that the beta versions have become more or less stable. The goal now is to discover errors and resolve them.

Production or Generally Available (GA) means that MySQL developers have the impression that the version is mature and stable enough that it can be used for mission-critical purposes. According to the MySQL documentation, in production versions, only corrections, and no new functionality, are to be expected. However, this has not always held true in the past, and even with stable versions substantial changes have been made. Of particular note is the case of MySQL 3.23.n. After the version had been declared stable (3.23.32), there came general support for InnoDB and BDB tables (3.23.34), and later, integrity rules for InnoDB tables (3.23.44). Furthermore, many minor extensions were introduced. As a rule, MySQL developers are pleased with such extensions, but at the same time, compatibility problems among different production versions can arise. In practice, this means that a new MySQL version (that is, n.n.0) always has the status alpha. With higher version numbers, the status rises to beta, gamma, and finally, production. Normal MySQL users should use exclusively MySQL versions that have the status production. If you are developing web applications, you should find out which version your Internet service provider is using. (Since Internet service providers are concernced with maintenance and stability, they are not generally keen on using the latest version, preferring earlier versions, which may not contain many of the functions of the newer versions.)

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.119.105' (10061)

报错原因

  • 默认mysql是无法远程连接,需要修改mysql.user的Host字段,默认Host字段的的数据都是'127.0.0.1' 只能本地连接数据库,可以修改为'%',然后flush privileges;这样就可以远程访问了。如果这因为这个原因而无法远程访问的错误提示是:ERROR 1045 (28000): Access denied for user 'yushan'@'192.168.119.102' (using password: YES)。
  • 我在linux上安装了mysql,远程使用windows连接,结果提示:ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.119.105' (10061),找到这一句: bind-address           = 127.0.0.1 ,将其注释掉,然后sudo service mysql restart 重启动。可以连接了!
  • 如果是windows平台的mysql服务器无法被远程连接,可以禁用windows防火墙(net stop sharedaccess),mysql平台:/etc/init.d/iptables stop
  • 确认/etc/mysql/my.cnf文件skip-networking 选项也被注释掉。skip-networking的作用是禁用tcp/ip连接,彻底杜绝mysql远程连接。现在新版本都没有开启skip-networking。

在线选课系统

在线选课系统

在硬盘里面一个偏僻的角落翻出来的,上大二学《数据库》的课程设计写的在线选课系统,用的php+mysql。那个时候初学php,mysql,代码相当蛋疼,还有报错,但是勾起了很多美好的回忆。下载链接:http://tunps.com/lab/oes.rar

小吞AA制记账系统

小吞AA制记账系统

小吞AA制记账系统 是去年10月份写的个人财务管理系统,采用php+mysql,smarty模板引擎。那个时候和同学合租,因为买菜之类的需要AA,就需要报账,所以需求出来了,就写了一个。可以添加、删除、修改,有公费、私费类别,公费可以结算,私费可以算自己的小帐。可以按比例结算,比如4:6的比例来结算。

安装:下载源码

http://tunps.com/lab/php/aa.zip

比如下载到目录d:\www\aa\,用PMA新建数据库,比如名字是expense,然后导入d:\www\aa\expense.sql,修改d:\www\aa\data\config.php 设置你的mysql数据库的用户名、密码、数据库名信息 就可以使用了。

默认的测试数据里面帐号用户名/密码有:admin/admin cc/cc sj/sj lgy/lgy hk/hk ,密码是 md5("用户名") ,你可以自行修改user表来管理用户。