Networknet archive Notes

Mysql

Originally published Last updated

The following notes were used by me when re-creating and migrating some of the websites on my local virtual machine.

How to create new database in mysql?

SQL1 line
1
create database networknet;

How to create new mysql database user for Wordpress or CMSMadeSimple installations?

SQL1 line
1
GRANT ALL PRIVILEGES ON *.* TO 'Ivan'@'localhost' IDENTIFIED BY 'P@ssw@rd1' WITH GRANT OPTION;

How to reset 'root' password for mysql on a Ubuntu JeOS 8.04 system and MySQL5?

Shell7 lines
1
2
3
4
5
6
7
sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables
mysql
UPDATE mysql.user SET Password=PASSWORD('P@ssw@rd1') WHERE User='root';
FLUSH PRIVILEGES;
CRTL-C to stop mysqld_safe process
sudo /etc/init.d/mysql start