Use "INTO OUTFILE" directive in your queries to export data from mysql into a text file.
mysql> select * from videos order by artist INTO OUTFILE "c:\videos.csv"
Query OK, 3269 rows affected (0.05 sec)
Use "FIELDS TERMINATED BY" directive to determine delimiter between fields.
mysql> select * from videos order by artist INTO OUTFILE "c:\videos.csv" FIELDS TERMINATED BY "|";
Query OK, 3269 rows affected (0.06 sec)
If you do not specify absolute path in "INTO OUTFILE" directive, the file will be recorded in current database's path. For example, assume that mysql is installed in "D:\dev\mysql" and the current database is "video_db"; then the path of videos.csv would be "D:\dev\mysql\data\video_db".
database etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
database etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
25 Nisan 2008 Cuma
24 Nisan 2008 Perşembe
How To Change MySql Root Password
In this example, I am going to change mysql root account's password from 1234 to 123456 using SQL. The queries are so self-explanatory. So, there is no need to describe them.
D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD("123456") where User="root";
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD("123456") where User="root";
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Etiketler:
administration,
commands,
database,
mysql,
password change
14 Nisan 2008 Pazartesi
Some Mysql-Specific Commands
Following is a list of some of mysql specific commands that I frequently use. You should be connected to mysql server through the command-line to execute the commands.
>show databases;
Display the list of databases hosted by the mysql server
>use db;
Selects the database to be working on.
>desc table;
Describes the metadata of the table;
>show tables;
Display tables of the selected database
>source test.sql;
execute an SQL script file
>show databases;
Display the list of databases hosted by the mysql server
>use db;
Selects the database to be working on.
>desc table;
Describes the metadata of the table;
>show tables;
Display tables of the selected database
>source test.sql;
execute an SQL script file
Etiketler:
administration,
commands,
database,
mysql
Kaydol:
Kayıtlar (Atom)