TopicNavigationUser login |
MySQLBasic LAMP Performance TuningLinux: sysctl -w vm.swappiness=20 echo "vm.swappiness = 20" >> /etc/sysctl.conf Optimize all tables scriptfor i in `mysql -B -e "show databases"|grep -v Database`; \ do for j in `mysql $i -B -e "show tables;"|grep -v Tables_`; \ do mysql $i -e "optimize table $j";done;done; Deleting a MySQL UserIf you're using MySQL 4.1.1 or newer, you can use the following: DROP USER user@host;On older versions, you'll need to use: DELETE FROM mysql.user WHERE User='user' AND Host='host'; FLUSH PRIVILEGES; Upgrading MySQLThis article relates to upgrading MySQL on Redhat linux, but may be applicable to other OSes as well. Here's the short version:
Submitted by jkelly on Sun, 2006-08-13 08:02. categories [ Article | MySQL | Redhat Linux ]
read more
Changing a MySQL user's passwordTo set the password of an existing user, you use: SET PASSWORD FOR 'user'@'host' = PASSWORD('newpass'); An equivalent command is: UPDATE mysql.user SET Password=PASSWORD('newpass') WHERE User='user' AND Host='host'; FLUSH PRIVILEGES; Adding MySQL Users / Setting User PrivilegesThe syntax for adding a user is: mysql> GRANT [privs] ON [db] TO [user]@[host] IDENTIFIED BY [pass]; e.g. mysql> GRANT ALL PRIVILEGES ON testdb.* TO 'bob'@'localhost' IDENTIFIED BY '3kuh3Ok'; Would grant all privileges on the testdb database to the local user bob, with password 3kuh3Ok. MySQL Performance TuningMatt Mongomery at MySQL has developed a great MySQL "tuning primer" that will suggest basic performance tuning settings. It is available at: http://www.day32.com/MySQL/tuning-primer.sh MySQL should be allowed at least 48 hours of normal operation before running, to allow for the best suggestions. |
Linux JournalSlashdot |