[color=green]-----------------------------------------------------------------
----------------mysql的登陆--------------------------------------
-----------------------------------------------------------------[/color]
[color=green]-----------------------------------------------------------------
----------------查看所有数据库-----------------------------------
-----------------------------------------------------------------[/color]
[color=green]-----------------------------------------------------------------
----------------使用某个数据库-----------------------------------
-----------------------------------------------------------------[/color]
[color=green]-----------------------------------------------------------------
----------------删除某个数据库-----------------------------------
-----------------------------------------------------------------[/color]
[color=green]------------------------------------------------------------------
----------------创建用户liutuo使之能从本地和远程访问--------------
------------------------------------------------------------------[/color]
[color=green]------------------------------------------------------------------
----------------创建数据库DQHK_20080904---------------------------
------------------------------------------------------------------[/color]
[color=green]------------------------------------------------------------------
----------------导出数据------------------------------------------
------------------------------------------------------------------[/color]
[color=green]------------------------------------------------------------------
----------------导入数据------------------------------------------
------------------------------------------------------------------[/color]
[color=green]------------------------------------------------------------------
----------------删除数据------------------------------------------
------------------------------------------------------------------[/color]
----------------mysql的登陆--------------------------------------
-----------------------------------------------------------------[/color]
mysql>mysql -u DQHK -p[color=green]-----------------------------------------------------------------
----------------查看所有数据库-----------------------------------
-----------------------------------------------------------------[/color]
mysql>show databases;[color=green]-----------------------------------------------------------------
----------------使用某个数据库-----------------------------------
-----------------------------------------------------------------[/color]
mysql>use DQHK;[color=green]-----------------------------------------------------------------
----------------删除某个数据库-----------------------------------
-----------------------------------------------------------------[/color]
mysql>drop database db_name;[color=green]------------------------------------------------------------------
----------------创建用户liutuo使之能从本地和远程访问--------------
------------------------------------------------------------------[/color]
mysql>grant all privileges on *.* to 'liutuo'@'localhost' identified by '123452' with grant option;
mysql>grant all privileges on *.* to 'liutuo'@'%' identified by '123452' with grant option;[color=green]------------------------------------------------------------------
----------------创建数据库DQHK_20080904---------------------------
------------------------------------------------------------------[/color]
mysql>create database DQHK_20080904;[color=green]------------------------------------------------------------------
----------------导出数据------------------------------------------
------------------------------------------------------------------[/color]
[web@nwtgzlx ~]$ mysqldump -u liutuo -p -h localhost DQHK > DQHK_20080904.SQL;[color=green]------------------------------------------------------------------
----------------导入数据------------------------------------------
------------------------------------------------------------------[/color]
mysql>source /home/web/DQHK_20080904.SQL;[color=green]------------------------------------------------------------------
----------------删除数据------------------------------------------
------------------------------------------------------------------[/color]
mysql>select count(*) from DirectoryMaster where sourceid=2;
mysql>delete from BusinessNameIndex where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from CategorySearch where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from ContactInfo where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from ResidentialNameIndex where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from CaptionIndex where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from GovernmentNameIndex where directoryid in(select directoryid from DirectoryMaster where sourceid=2);
mysql>delete from DirectoryMaster where sourceid=2;

被折叠的 条评论
为什么被折叠?



