Difference between revisions of "Mysql"

From MyWiki
Jump to: navigation, search
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
+
[[ Altering column ]]<br>
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
+
[[ Column types ]]<br>
  LINES TERMINATED BY '\n'
+
[[ Creating a mysql user ]]<br>
  FROM test_table;
+
[[ Creating users ]] <br>
 
+
[[ Determine which storage engine is being used ]] <br>
 
+
[[ Find duplicates ]]<br>
SELECT order_id,product_name,qty FROM orders
+
[[ Find the size of mysql database ]]<br>
INTO OUTFILE '/tmp/orders.csv'
+
[[ Selecting into a csv file ]]<br>
FIELDS TERMINATED BY ','
+
[[ Indexes ]]<br>
ENCLOSED BY '"'
+
[[ Selecting a table from a mysqldump file ]]<br>
LINES TERMINATED BY '\n'
+
[[ PHP mysqli_real_escape_string() Function ]]<br>
 
+
[[ mysqldump to file with line terminations ]] <br>
USE mysql;
+
[[ mysqldump selecting tables only ]]<br>
UPDATE user SET File_priv = 'Y' WHERE User = 'db_user';
+
[[ Preventing database hanging when using mysqldump ]] <br>
FLUSH PRIVILEGES;
+
[[ Regular expressions ]]<br>
 +
[[ Setting a prinary key ]]<br>
 +
[[ Setting the root password ]]<br>
 +
[[ Test db for user creation ]]<br>
 +
[[ Update two columns ]]<br>
 +
[[ Users ]]<br>
 +
[[ Insert ignore to avoid updating existing record ]] <br>
 +
[[ Enable MySQL’s slow query log without a restart ]]<br>
 +
[[ Securing mysql with a script ]]<br>

Latest revision as of 12:15, 28 August 2017

Altering column
Column types
Creating a mysql user
Creating users
Determine which storage engine is being used
Find duplicates
Find the size of mysql database
Selecting into a csv file
Indexes
Selecting a table from a mysqldump file
PHP mysqli_real_escape_string() Function
mysqldump to file with line terminations
mysqldump selecting tables only
Preventing database hanging when using mysqldump
Regular expressions
Setting a prinary key
Setting the root password
Test db for user creation
Update two columns
Users
Insert ignore to avoid updating existing record
Enable MySQL’s slow query log without a restart
Securing mysql with a script