| | Delete MySQL user
To remove a MySQL user account run this command:
mysql> drop user [username];
Dropping user will not disconnect an active database session, it will take effect after the user disconnects. | | More... 10/19/06 | | | | | | | | |
|
| | How to save query results in a text file
Here's how to put MySQL query results in an ASCII file i.e. tab delimited or CSV file.
mysql> SELECT field1, field2 FROM tab1 INTO OUTFILE 'logfile.txt';
By default fields will be separated by tab, but you can change it using the following command:
mysql> SELECT field1, field2 FROM tab1
... | | More... 10/19/06 | | | | | | | | |
|
| | How to rename MySQL table
It's quite easy to change a name of MySQL table and the syntax is similar to that of other databases. Of course you'd have to make sure the table name is not hardcoded somewhere i.e. in a php script. Just run this command:
mysql> RENAME TABLE tab_a TO tab_b;
| | More... 10/19/06 | | | | | | | | |
|
| | Create new MySQL user account
The command below will create MySQL user called 'testuser' on localhost with all privileges for database called 'testdb' and with password 'mypassword'. Connect to the server with mysql and run command:
grant all on testdb.* to testuser@localhost identified by 'mypassword';
| |  More... 10/17/06 | | | | | | | | |
|
| | How to change ft_min_word_len variable
Normally it is not recommended to change variables that control MySQL fulltext index behaviour (such as ft_min_word_len or ft_max_word_len) but if you really need to...
MySQL config file would usually be found on Windows under C:\Windows\my.ini and on Linux under /etc/my.cnf Edit the file and add
[mysqld]
ft_min_word_len = 3
The default value is ... | | More... 10/17/06 | | | | | | | | |
|
|