Mysql中如何批量生成脚本
[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 |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql>
mysql> use information_schema
Database changed
INFORMATION_SCHEMA提供了访问数据库元数据的方式。
元数据是关于数据的数据,如数据库名或表名,列的数据类型,或访问权限等。有些时候用于表述该信息的其他术语包括“数据词典”和“系统目录”
最通俗我们可以看成是保存系统信息(数据字典)的scheme。
mysql> show tables;
+---------------------------------------+
| Tables_in_information_schema |
+---------------------------------------+
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENGINES &nbs
相关文档:
在程序开发中,有时会被字符乱码的问题所困扰。对此,必须理解 MySQL 的字符集编码设置的原理:在MySQL中,默认使用的是lartin1,也就是ISO8859-1字符集编码。这是一种8位的编码,适用于所有西欧字符。而对于汉字等是不合适的。最好、最通用的编码格式是utf-8,UTF-8(8 位元 Universal Cha ......
1、解压 mysql-noinstall-5.1.30-win32.zip
2、在 F 盘建立目录 MySql\MySqlServer5.1\
3、把解压的内容复制到 F:\MySql\MySqlServer5.1\
4、在 F:\MySql\MySqlServer5.1\ 中找 my-large.ini 把它复制成 my.ini
5、在 my.ini 中找 [mysqld] ,添加以下语句;
basedir="F:/MySql/MySqlServer5.1/"
datadir="F:/My ......
1、登陆MySQL:
mysql -u root -p
2、查看用户信息
select user,host,password from mysql.user;
select user,host from mysql.user;
3、设置密码
set password for root@localhost=password('
在这里填入root密码
');
4、修改密码
方法1:mysqladmin -u root -p password newpassword
方法2: #mysql -u root ......
解决乱码最好的方法是在项目设计之初,统一所有的字符集,例如页面、request对象以及数据库等等。
一、 几种常见的乱码现象:
1、页面乱码
单纯的页面乱码是很好解决的,只要修改头部适合的字符集即可,如果页面中文显示乱码,你可以把字符集修改为:gb2312或gbk。
2、页面之间传递的参数是乱码 ......
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 ......