---
id: 14
title: 'MySQL – Startup Tips'
date: 2003-03-01T17:44:17+00:00
author: hky
layout: post
guid: http://lostfocus.org/blog/?p=14
permalink: /mysql-startup-tips/
tags:
  - Lab
---
**Setting password root untuk pertama kali**
  
`$mysqladmin -u root password 'password baru'`

**Masukin user baru**
  
`$mysql -u root -p mysql<br />
mysql>insert into user (host, user, password) values ('%','hengky', password('passwordnya'));`

**Buat database baru**
  
`mysql>use mysql;<br />
mysql>create database hky;<br />
mysql>grant all privileges on hky.* to hengky;<br />
myaql>flush privileges;`

**Ganti password dan kasi grant ke satu orang user(hengky)**
  
``**Setting password root untuk pertama kali**
  
`$mysqladmin -u root password 'password baru'`

**Masukin user baru**
  
`$mysql -u root -p mysql<br />
mysql>insert into user (host, user, password) values ('%','hengky', password('passwordnya'));`

**Buat database baru**
  
`mysql>use mysql;<br />
mysql>create database hky;<br />
mysql>grant all privileges on hky.* to hengky;<br />
myaql>flush privileges;`

**Ganti password dan kasi grant ke satu orang user(hengky)**
  
`` 

**Load file yang berisi skema database (sql syntax)**
  
`$mysql -u hengky -p namadatabase < filenya.sql`

**Backup database**
  
</code>`$mysqldump -A -u root -p > backup.sql`