Setup MYSQL on Linux

Thursday, October 30 2008 at 11:30, posted by Norman

manual setup:
1. install server and client using yum(fedora, redhat) or apt-get(ubuntu)
2. log on as root(in new installation, no password needed)

mysql -uroot -p
3. change database to mysql
change database mysql;
4. set root password
mysqladmin -u root password 'new-password'  (in cl)
update mysql.user set password = password('mypassword') where user = 'root';
or
SET PASSWORD FOR usr@Host = PASSWORD('newpassword'); //do step 3 before this
5. create new database
create database newname;
6. creat new user and gant privileges
grant usage on *.* to newuser indentified by 'password';
grant ALL on databasename.* to newuser;
7. flush privileges;

phpMyadmin setup: If install phpMyadmin, just connect localhost and everything is there.