MySQL的安装(免安装版本)
一、下载MySQL
官方网站:www.mysql.org
二、安装
1.将此压缩包解压缩到制定文件夹下,以"C:/mysql"为例
2.将my-midium.ini复制一份,并重命名为my.ini
3.将C:/mysql/bin/libmysql.dll复制到系统目录下,例如复制到"C:/windows"下
4.在命令行模式下,运行C:/mysql/bin/mysqld,即可开启MySQL服务器的守护过程,如果关闭,可进入C:/mysql/bin下,输入:
mysql admin -u root -p shutdown(root有密码)
mysql admin -u root shutdown(root无密码)
修改root密码:
(一)没密码时
1.开启守护进程,即运行"C:/mysql/bin/mysql"
2.在命令行模式下,进入"C:/mysql/bin"目录,输入:mysqladmin -u root password 'your password'
其中'your password'为你要设定的密码
(二)有密码时
1.在命令行模式下,进入"C:/mysql/bin"目录,输入(开启守护进程):mysqld --skip -grant -tables
2.输入:mysql 进入mysql命令行,提示符为"mysql>"
3.输入:
use mysql
update user set password=''
where user='root' and host='local host';
exit
4.输入 mysqladmin -uroot password 'your password',设置您的密码
相关文档:
在主外键表存在关系的时候如果加上"lazy=true"的话,则表明延迟,即只查询主表中的内容,而不查询外键表中的内容。
例:
<hibernate-mapping>
<class name="com.pojo.Sortp" table="sortp" catalog="shjdc">
<id name="id" type= ......
1.设置变量
set @x = 2;
或:
select @x := max(fields) as max from table;
2.生成html或xml
mysql -H -uroot -p databaseName 生成html文件
mysql -x -uroot -p databaseNam ......
[root@sql21 ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.1.26-rc-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database &nb ......
下面是commond:
MySQLCommand cmd;
cmd = new MySQLDriverCS.MySQLCommand("DROP TABLE IF EXISTS test.mysqldrivercs_test",conn);
cmd.ExecuteNonQuery();
cmd.Dispose();
下面是insert:
string Value = "Value";
int SettingID = 1;
new MySQLInsertCommand(conn,
new object[,] {{"SettingID",SettingID},{"S ......