mySQL

JSON

rev 23  |  foxhop  |  1356022339000  |  JSON

rev 22
rev 23
95.. code-block:: mysql95.. code-block:: mysql
9696
n97 GRANT SELECT, LOCK TABLES ON *.* TO username@localhost IDENTIFIED BY 'passw0rd'n97 GRANT SELECT, LOCK TABLES ON *.* TO backup_user@localhost;
>; 
9898
9999
tt100Backup all databases into separate files
101--------------------------------------------------
102 
103.. code-block:: bash
104 
105 #!/bin/bash
106 
107 USER="backup_user"
108 PASSWORD=""
109 TODAY=`date +%Y-%m-%d`
110 OUTPUTDIR="/backup/db/$TODAY"
111 MYSQLDUMP="/usr/bin/mysqldump"
112 MYSQL="/usr/bin/mysql"
113 
114 mkdir $OUTPUTDIR
115 
116 # get a list of databases
117 databases=`$MYSQL --user=$USER --password=$PASSWORD \
118  -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
119 
120 # dump each database in turn
121 for db in $databases; do
122     $MYSQLDUMP --force --opt --user=$USER --password=$PASSWORD \
123     --databases $db > "$OUTPUTDIR/$db.sql"
124 done
125 
126Reference: `Backup multiple mysql databases into separate files <http://www.snow
 >frog.net/2005/11/16/backup-multiple-databases-into-separate-files/>`_
rev 22  |  foxhop  |  1356020617000  |  JSON

rev 21
rev 22
93------------------------------------------------------------93------------------------------------------------------------
9494
t95.. code-block::t95.. code-block:: mysql
9696
97 GRANT SELECT, LOCK TABLES ON *.* TO username@localhost IDENTIFIED BY 'passw0rd'97 GRANT SELECT, LOCK TABLES ON *.* TO username@localhost IDENTIFIED BY 'passw0rd'
>;>;
rev 21  |  foxhop  |  1356020594000  |  JSON

rev 20
rev 21
8888
89 mysqladmin -u root -p processlist89 mysqladmin -u root -p processlist
tt90 
91 
92Create a read only user for backing up databases
93------------------------------------------------------------
94 
95.. code-block::
96 
97 GRANT SELECT, LOCK TABLES ON *.* TO username@localhost IDENTIFIED BY 'passw0rd'
 >;
98 
99 
rev 20  |  foxhop  |  1355162517000  |  JSON

rev 19
rev 20
5252
5353
tt54Restore database
55-----------------------
56 
57The following command with restore a database from a backup .sql file
58 
59.. code-block:: bash
60 
61 mysql -u username -p lostquery < lostquery-backup-2012-12-10.sql
62 
63 
64 
54Drop user65Drop user
55-------------66-------------
rev 19  |  foxhop  |  1336063843000  |  JSON

rev 18
rev 19
69 DROP DATABASE databasename69 DROP DATABASE databasename
7070
t71dt71 
7272
73Show the MySQL processlist or list of currently running queries73Show the MySQL processlist or list of currently running queries
rev 18  |  foxhop  |  1335864119000  |  JSON

rev 17
rev 18
7272
73Show the MySQL processlist or list of currently running queries73Show the MySQL processlist or list of currently running queries
t74=======================================================================t74--------------------------------------------------------------------------
7575
76.. code-block:: mysql76.. code-block:: mysql
rev 17  |  foxhop  |  1335864095000  |  JSON

rev 16
rev 17
6868
69 DROP DATABASE databasename69 DROP DATABASE databasename
tt70 
71d
72 
73Show the MySQL processlist or list of currently running queries
74=======================================================================
75 
76.. code-block:: mysql
77 
78 mysqladmin -u root -p processlist
rev 16  |  foxhop  |  1333270590000  |  JSON

rev 15
rev 16
55-------------55-------------
5656
tt57.. code-block:: sql
58 
57DROP USER username@localhost59 DROP USER username@localhost
60 
61 
62 
63Drop database
64-------------------------
65 
66 
67.. code-block:: sql
68 
69 DROP DATABASE databasename
rev 15  |  foxhop  |  1333237132000  |  JSON

rev 14
rev 15
30.. code-block:: mysql30.. code-block:: mysql
31 31 
n32 create database lostqueryn32 CREATE DATABASE lostquery
3333
t34Make a user for this database...t34Or optionally make Character set utf8 for unicode support
35 
36.. code-block:: mysql
37 
38 CREATE DATABASE lostquery DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unico
 >de_ci;
39 
40 
41 
3542
3643
rev 14  |  foxhop  |  1303938267000  |  JSON

rev 13
rev 14
38---------------------38---------------------
3939
t40The following command will create a user, create its password, and grant it accet40The following command will create a user with a password and grant all privilege
>ss to a database:>s to the user on a particular database:
41 
4241
43.. code-block:: mysql42.. code-block:: mysql
rev 13  |  foxhop  |  1303938157000  |  JSON

rev 12
rev 13
25Create database25Create database
26------------------26------------------
n27log into mysql as root::n27log into mysql as root:
2828
2929
n30.. code-block :: mysqln30.. code-block:: mysql
31 31 
32    create database lostquery32 create database lostquery
3333
34Make a user for this database...34Make a user for this database...
38---------------------38---------------------
3939
n40The following command will create a user, create its password, and grant it accen40The following command will create a user, create its password, and grant it acce
>ss to a database::>ss to a database:
4141
4242
n43.. code-block :: mysqln43.. code-block:: mysql
4444
t45    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'past45 GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'passw0
>sw0rd' WITH GRANT OPTION>rd' WITH GRANT OPTION
4646
4747
rev 12  |  foxhop  |  1303938035000  |  JSON

rev 11
rev 12
2828
2929
n30.. code-block:: mysqln30.. code-block :: mysql
3131
32    create database lostquery32    create database lostquery
4141
4242
t43 t
44.. code-block:: mysql43.. code-block :: mysql
4544
46    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'pas45    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'pas
>sw0rd' WITH GRANT OPTION>sw0rd' WITH GRANT OPTION
rev 11  |  foxhop  |  1303937978000  |  JSON

rev 10
rev 11
27log into mysql as root::27log into mysql as root::
2828
nn29 
30.. code-block:: mysql
31 
29  create database lostquery32    create database lostquery
3033
31Make a user for this database...34Make a user for this database...
37The following command will create a user, create its password, and grant it acce40The following command will create a user, create its password, and grant it acce
>ss to a database::>ss to a database::
3841
tt42 
43 
44.. code-block:: mysql
45 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'pas46    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'pas
>sw0rd' WITH GRANT OPTION>sw0rd' WITH GRANT OPTION
4047
rev 10  |  foxhop  |  1301174080000  |  JSON

rev 9
rev 10
37The following command will create a user, create its password, and grant it acce37The following command will create a user, create its password, and grant it acce
>ss to a database::>ss to a database::
3838
t39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@st39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'pas
>sw0rd' WITH GRANT OPTION>sw0rd' WITH GRANT OPTION
4040
4141
rev 9  |  foxhop  |  1290645961000  |  JSON

rev 8
rev 9
t1 http://www.anxietycare.net/ valium %-) http://www.qualityremedy.com/ buy 150 trt1mySQL
>amadol tablets 863607  
2========
3 
4mySQL database information.
5 
6.. contents::
7 
8Full-Text Minimum word length
9--------------------------------
10 
11 
12Full-text minimum length default is set to 4.  To adjust this setting, edit /etc
 >/mysql/my.cnf and add the following line under [mysqld]::
13 
14 ft_min_word_len = 3
15 
16Next we need to restart mysql::
17 
18 $ sudo service mysql restart
19  
20Last repair the full-text index on the table::
21 
22 mysql> REPAIR TABLE table_name QUICK
23 
24 
25Create database
26------------------
27log into mysql as root::
28 
29  create database lostquery
30 
31Make a user for this database...
32 
33 
34Create a user
35---------------------
36 
37The following command will create a user, create its password, and grant it acce
 >ss to a database::
38 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@s
 >sw0rd' WITH GRANT OPTION
40 
41 
42Drop user
43-------------
44 
45DROP USER username@localhost
rev 8  |  unknown  |  1290634788000  |  JSON

rev 7
rev 8
t No Differences Found t No Differences Found 
rev 7  |  unknown  |  1290634782000  |  JSON

rev 6
rev 7
t1mySQLt1 http://www.anxietycare.net/ valium %-) http://www.qualityremedy.com/ buy 150 tr
 >amadol tablets 863607 
2========
3 
4mySQL database information.
5 
6.. contents::
7 
8Full-Text Minimum word length
9--------------------------------
10 
11 
12Full-text minimum length default is set to 4.  To adjust this setting, edit /etc
>/mysql/my.cnf and add the following line under [mysqld]:: 
13 
14 ft_min_word_len = 3
15 
16Next we need to restart mysql::
17 
18 $ sudo service mysql restart
19  
20Last repair the full-text index on the table::
21 
22 mysql> REPAIR TABLE table_name QUICK
23 
24 
25Create database
26------------------
27log into mysql as root::
28 
29  create database lostquery
30 
31Make a user for this database...
32 
33 
34Create a user
35---------------------
36 
37The following command will create a user, create its password, and grant it acce
>ss to a database:: 
38 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@s
>sw0rd' WITH GRANT OPTION 
40 
41 
42Drop user
43-------------
44 
45DROP USER username@localhost
rev 6  |  foxhop  |  1289340201000  |  JSON

rev 5
rev 6
t1e6bOru  <a href="http://glkkyqifydug.com/">glkkyqifydug</a>, [url=http://uqvnwcdt1mySQL
>kuksq.com/]uqvnwcdkuksq[/url], [link=http://jjuelxedncuw.com/]jjuelxedncuw[/link 
>], http://zoanhzbalqge.com/ 
2========
3 
4mySQL database information.
5 
6.. contents::
7 
8Full-Text Minimum word length
9--------------------------------
10 
11 
12Full-text minimum length default is set to 4.  To adjust this setting, edit /etc
 >/mysql/my.cnf and add the following line under [mysqld]::
13 
14 ft_min_word_len = 3
15 
16Next we need to restart mysql::
17 
18 $ sudo service mysql restart
19  
20Last repair the full-text index on the table::
21 
22 mysql> REPAIR TABLE table_name QUICK
23 
24 
25Create database
26------------------
27log into mysql as root::
28 
29  create database lostquery
30 
31Make a user for this database...
32 
33 
34Create a user
35---------------------
36 
37The following command will create a user, create its password, and grant it acce
 >ss to a database::
38 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@s
 >sw0rd' WITH GRANT OPTION
40 
41 
42Drop user
43-------------
44 
45DROP USER username@localhost
rev 5  |  unknown  |  1289332897000  |  JSON

rev 4
rev 5
t No Differences Found t No Differences Found 
rev 4  |  unknown  |  1289332891000  |  JSON

rev 3
rev 4
t145Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhnht1e6bOru  <a href="http://glkkyqifydug.com/">glkkyqifydug</a>, [url=http://uqvnwcd
>ydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/link>kuksq.com/]uqvnwcdkuksq[/url], [link=http://jjuelxedncuw.com/]jjuelxedncuw[/link
>], http://phvlkkcscupb.com/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqj>], http://zoanhzbalqge.com/
>mz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqn 
>kbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com/45Yp5B  <a href="http://sw 
>xyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/u 
>rl], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com 
>/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhn 
>hydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/lin 
>k], http://phvlkkcscupb.com/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaq 
>jmz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotq 
>nkbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com/ 
rev 3  |  unknown  |  1289288695000  |  JSON

rev 2
rev 3
t No Differences Found t No Differences Found 
rev 2  |  unknown  |  1289288689000  |  JSON

rev 1
rev 2
t1mySQLt145Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhnh
 >ydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/link
 >], http://phvlkkcscupb.com/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqj
 >mz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqn
 >kbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com/45Yp5B  <a href="http://sw
 >xyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/u
 >rl], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com
 >/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaqjmz</a>, [url=http://pakfhn
 >hydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotqnkbn.com/]ednrbotqnkbn[/lin
 >k], http://phvlkkcscupb.com/45Yp5B  <a href="http://swxyuwkaqjmz.com/">swxyuwkaq
 >jmz</a>, [url=http://pakfhnhydxuo.com/]pakfhnhydxuo[/url], [link=http://ednrbotq
 >nkbn.com/]ednrbotqnkbn[/link], http://phvlkkcscupb.com/
2========
3 
4mySQL database information.
5 
6.. contents::
7 
8Full-Text Minimum word length
9--------------------------------
10 
11 
12Full-text minimum length default is set to 4.  To adjust this setting, edit /etc
>/mysql/my.cnf and add the following line under [mysqld]:: 
13 
14 ft_min_word_len = 3
15 
16Next we need to restart mysql::
17 
18 $ sudo service mysql restart
19  
20Last repair the full-text index on the table::
21 
22 mysql> REPAIR TABLE table_name QUICK
23 
24 
25Create database
26------------------
27log into mysql as root::
28 
29  create database lostquery
30 
31Make a user for this database...
32 
33 
34Create a user
35---------------------
36 
37The following command will create a user, create its password, and grant it acce
>ss to a database:: 
38 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@s
>sw0rd' WITH GRANT OPTION 
40 
41 
42Drop user
43-------------
44 
45DROP USER username@localhost
rev 1  |  foxhop  |  1276973869000  |  JSON

empty
rev 1
tt1mySQL
2========
3 
4mySQL database information.
5 
6.. contents::
7 
8Full-Text Minimum word length
9--------------------------------
10 
11 
12Full-text minimum length default is set to 4.  To adjust this setting, edit /etc
 >/mysql/my.cnf and add the following line under [mysqld]::
13 
14 ft_min_word_len = 3
15 
16Next we need to restart mysql::
17 
18 $ sudo service mysql restart
19  
20Last repair the full-text index on the table::
21 
22 mysql> REPAIR TABLE table_name QUICK
23 
24 
25Create database
26------------------
27log into mysql as root::
28 
29  create database lostquery
30 
31Make a user for this database...
32 
33 
34Create a user
35---------------------
36 
37The following command will create a user, create its password, and grant it acce
 >ss to a database::
38 
39    GRANT ALL PRIVILEGES ON lostquery.* TO username@localhost IDENTIFIED BY 'p@s
 >sw0rd' WITH GRANT OPTION
40 
41 
42Drop user
43-------------
44 
45DROP USER username@localhost