风火家人开发记要

技术总结精华贴

Category: Mysql

Mysql, 原创, 安卓

Android SQLite AUTO_INCREMENT 报错

在开发 Android应用程序使用数据库的时候,发现SQLite 创建表的时候使用AUTO_INCREMENT报错。找了一些资料发现SQLite使用sql语句还是跟Mysql的稍微有点区别的,下面是个在Mysql中使用语句常见表: CREATE TABLE `adinfo` ( `id` tinyint(4) NOT NULL AUTO_INCREMENT, `usetime` int(10) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 在使用SQLite创建的时候竟然有很多处错误。 1. AUTO_INCREMENT 修改方法: 将`id` tinyint(4) NOT NULL AUTO_INCREMENT,改为`id` INTEGER PRIMARY KEY AUTOINCREMENT, 同时需要去掉PRIMARY KEY (`id`) 2.ENGINE,DEFAULT CHARSET 修改方式:去掉ENGINE=InnoDB DEFAULT CHARSET=utf8,原因Mysql的数据引擎有很多,而SQLite不分这个, 还有默认字符串编码SQLite里面我暂时没有发现,不知道他有没有设置编码的地方。 (1308)

查看全文
Mysql, 原创,

多次安装wamp后Mysql无法启动解决方案Not first time to install wamp, Mysql cannot be started

如果不是首次安装wamp或着mysql,可能会遇到安装后无法启动的问题。我是由于升级wamp,升级后无法启动mysql服务。 下面是我的解决方法: 1.准备升级网站的时候首先备份mysql,如果因为安装mysql的路径不同,可能会导致mysql的数据无法使用,这个一定要先做。 2.卸载旧版的wamp或者mysql。(尝试安装新版wamp看是否成功,一般是mysql无法启动了)。 4.下面的方法是关键:删除mysql注册表 msyql安装到最后一步start service错误解决方法 1,到控制面板里面先把MySQL删除. 2.到c盘C:\Program Files目录下把MySQL目录删除. 3.如果在其他盘还有设置目录也要删除.空目录也要删除 4.到regedit把注册表 1. HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL 2. HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL 3. HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL 有的话,全部删除! (技巧:用F3循环查找“MySQL”) 5.如果任务管理器里有关MySQL内容也删除 通过上面的步骤一般都可以正常安装和启动mysql了。希望能对你有所帮助。If you are not the first time to install wamp or mysql,you may come across this problem,mysql unable to start up. I wanted to update wamp to the latest, and found that mysql server cannot be stated. This is my resolvent: 1.If you want to update your wamp or mysql ,you need first to backup mysql data first,or you may find some of data in database cannot be use. 2.uninstall older wamp or mysql.(you can try to install wamp to see it wether success or not.) 3.this below is the most impotent:delete mysql register mysql server cannot be start 1)  to Control Panel to delete Mysql 2) delete Mysql File in c:\Program Files 3) If there are  Mysql Files On Other disk,alse delete 4). Start->cmd->regedit  delete these (1). HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL (2). HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL (3). HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL you can use F3 to find MySQL 5.If there is mysql in Task Manager,alse delete. Use this,you can install now,hope it can help you. (1103)

查看全文