Archive for the tag 'sql'

SQL Join [w3schools]

Sometimes we have to select data from two or more tables to make our result complete. We have to perform a join.

Tables in a database can be related to each other with keys. A primary key is a column with a unique value for each row. Each primary key value must be unique within the table. The purpose is to bind data together, across tables, without repeating all of the data in every table.

Read more »

Reset password MySQL

Sedikit tutorial singkat yang diperoleh dari https://support.kwshell.com untuk mereset password mysql yang kelupaan. Semoga bisa membantu, jika tidak mungkin lebih baik membeli obat antilupa atau yang meningkatkan daya ingat otak kita :).

First you are going to need to stop mysqld from running so find the pid with “ps aux” and kill -9 PID. Then you can start mysqld with –skip-grant-tables option. Login to mysql as follows:

# mysql -u root -p mysql

Then at the mysql prompt type:

UPDATE mysql.user SET Password=PASSWORD(’password’) WHERE User=’root’;
FLUSH PRIVILEGES;

and replace ‘password’ with the pass you want to set it to.