-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathSQL.txt
94 lines (59 loc) · 2.45 KB
/
SQL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.0.13'
IDENTIFIED BY '25826' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON characters_bc.* TO 'rootbc'@'%'
IDENTIFIED BY 'bc25826' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON world.* TO 'siteadminvitasic'@'%'
IDENTIFIED BY 'tgby5hnu9jmi8kwsxe47dcrfv' WITH GRANT OPTION;
FLUSH PRIVILEGES;
UPDATE mysql.user SET Password=PASSWORD('kvjtjvKrtkvkzak') WHERE User = 'auth' AND host = '%';
GRANT ALL PRIVILEGES ON auth.* TO 'auth'@'%'
IDENTIFIED BY 'wow25826freedom' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Çàëèâàåì áàçû ëåãêî!!
// Âñå äåëàåòñÿ ÷åðåç êîíñîëü, ýêîíîìèò âðåìÿ â ðàçû!
// ïèøåì
mysql -u root -p25826
// òóò ïîïðîñèò ïàðîëü ðóòà! ââîäèì åãî
passblabla
òåïåðü âûáèðàåì áàçó â êîòîðóþ ëèòü! Åñëè åå íåò òî ñîçäàäèì à ïîòîì çàëüåì
CREATE DATABASE `world` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `characters1` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE `auth` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
// áàçû ñîçäàíû.. âûáèðàåì áàçó
use worldcata;
// óêàçàòåëü òåïåðü íà áàçå âûñòàâëÿåì êîäèðîâêó äëÿ çàëèâêè (íàì æå íåíóæíû êðàêîçÿáëû â ðóññêîì)
set names utf8;
// âñå òåïåðü ëüåì ôàéë
source /home/server/Cata/sql/world.sql
source /home/server/wow/lk/c/sql/characters.sql
// òóò êóðèì èëè âüåì êîôå íî ýòî íå î÷ äîëãî áóäåò) Ïóòü ó êàæäîãî ñâîé ê ôàéëàì áàçû! ß ëèøü ïðèìåð ïðèâåë.
// àíàëîãè÷íî ñ êàæäûé äëÿ âñåõ áàç! ïîâòîðÿåì
SELECT * FROM `creature` WHERE `id`=23709;
Ïîäêëþ÷åíèå ê mysql
mysql -uusername -ppassword -hlocalhost
Çäåñü ñîêðàùåíèÿ:
-h host
-u user
-p password
Ïðîáåë ïîñëå íèõ îòñóòñòâóåò.
Ïîñìîòðåòü èìåþùèåñÿ áàçû äàííûõ
mysql> show databases;
Ñîçäàòü áàçó äàííûõ ñ èìåíåì new_db
mysql> create database new_db default character set utf8;
Ïåðåêëþ÷åíèå ìåæäó áàçàìè (âûáîð êîíêðåòíîé áàçû)
mysql> use new_db;
Ïîñìîòðåòü èìåþùèåñÿ òàáëèöû â áàçå äàííûõ
mysql> show tables;
Ïîñìîòðåòü ñòðóêòóðó òàáëèöû zipcodes
mysql> describe zipcodes;
Óäàëèòü áàçó new_db
mysql> drop database new_db;
Çàëèâàåì äàìï áàçû äàííûõ èç old_db.sql â áàçó my_db
mysql -hlocalhost -uusername -ppassword my_db < old_db.sql
mysql -uroot -pgamesv world2 < YTDB_0.14.6_R630_TC_R117015_TDBAI_335_RuDB_R56.sql.sql
MYSQL -UUSERNAME -PPASSWORD -HHOST DB_NAME < FILE_NAME.SQL – çàëèòü áä;
mysqldump -uroot -p25826 world > /data/dump/world.sql;
mysqldump -uroot -p25826 characters > /data/dump/characters.sql;
http://wowjp.net/forum/120-237727-1