m (moved Mysql to MySQL)
m (Import a database)
Line 25: Line 25:
  
 
to import the database data (''wikilaussy-24-jan-10.sql'', a readable file with ''very long lines'') into the database structure (named ''wikilaussy'') above.
 
to import the database data (''wikilaussy-24-jan-10.sql'', a readable file with ''very long lines'') into the database structure (named ''wikilaussy'') above.
 +
 +
=== Change password ===
 +
 +
See [http://ubuntu.flowconsult.at/en/mysql-set-change-reset-root-password/]:
 +
 +
Stop the MySQL Server.
 +
sudo /etc/init.d/mysql stop
 +
 +
Start the mysqld configuration.
 +
sudo mysqld --skip-grant-tables &
 +
 +
Login to MySQL as root.
 +
mysql -u root mysql
 +
 +
Replace YOURNEWPASSWORD with your new password!
 +
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
  
 
== Links ==
 
== Links ==
  
 
* [http://blog.urfix.com/linux-command-line-mysql-awesome/ Linux command line and MySQL].
 
* [http://blog.urfix.com/linux-command-line-mysql-awesome/ Linux command line and MySQL].

Revision as of 22:33, 19 January 2014

Contents

MySQL

MySQL is the best database we know. That's what we use.

Survival kit

SHOW databases;

is may be the most important command. It shows you what's in store.

Create a user

CREATE USER 'laussy' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO 'laussy';

Import a database

From the command line:

mysql -u laussy -p wikilaussy < wikilaussy-24-jan-10.sql

to import the database data (wikilaussy-24-jan-10.sql, a readable file with very long lines) into the database structure (named wikilaussy) above.

Change password

See [1]:

Stop the MySQL Server.

sudo /etc/init.d/mysql stop

Start the mysqld configuration.

sudo mysqld --skip-grant-tables &

Login to MySQL as root.

mysql -u root mysql

Replace YOURNEWPASSWORD with your new password!

UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;

Links