- Connect to machine via ssh - writer using ubuntu 11.04
#ssh -Y [email protected]
[email protected] password:
bloon@ubuntu:~$ -
Run as sudo
bloon@ubuntu:~$sudo su
-
Run mysql
//-h : host mysql server
//-u : username
//-p : password
root@ubuntu:#mysql -h 127.0.0.1 -u root -p
The program mysql can be found in the following packages:
* mysql-client-core-5.1
* mysql-cluster-client-5.1
Try: apt-get install
Oppsss, mysql-client is not installed yet
- Install mysql-client
root@ubuntu:#apt-get install mysql-client-core-5.1
-
Run mysql client again
bloon@ubuntu:#mysql -h 127.0.0.1 -u root -p
mysql> -
Now create user. There are many ways, this the easiest and fastets on mine
mysql> CREATE USER bego @'localhost IDENTIFIED BY bego_pass ;
mysql> GRANT ALL PRIVILEGES ON . TO bego @'localhost WITH GRANT OPTION;
mysql> CREATE USER bloon @'% IDENTIFIED BY bloon_pass ;
mysql> GRANT ALL PRIVILEGES ON . TO bloon @'% WITH GRANT OPTION;
mysql> CREATE USER ndableg @'localhost ;
mysql> GRANT RELOAD,PROCESS ON . TO admin @'localhost ;
mysql> CREATE USER blee @'localhost ;
Keterangan :
user bego only can be remote from localhost ( bego @ localhost ) dengan akses SU
user bloon can be remote from anywhere( bloon @ % ) dengan akses SU
user ndableg only can be remote from localhost with limited acces RELOAD dan PROCCESS
user blee only can be accessed from localhost , can not be used yet. Can be added in other time
- Now, u can test user. Open new terminal tab (ctrl+shift+t)
root@us-djafa:/home/djafa# mysql -h 192.168.18.131 -u bloon -p
Enter password:
Welcome to the MySQL monitor.
mysql>
Alhamdulillah proses penambahanMySQL user selesai
1. Masuk Server - writer using ubuntu 11.04
#ssh -Y [email protected]
- Jalankan sudo secara explicit
bloon@ubuntu:~$sudo su
-
Jalankan mysql-client ( Untuk menambah user, anda harus mempunyai user mysql dengan privileges full atau setidaknya menambah user)
//-h : host mysql server
//-u : username
//-p : password
root@ubuntu:#mysql -h 127.0.0.1 -u root -p
The program mysql can be found in the following packages:
* mysql-client-core-5.1
* mysql-cluster-client-5.1
Try: apt-get install
Oppsss, mysql-client is not installed yet
- Install mysql-client
root@ubuntu:#apt-get install mysql-client-core-5.1
-
Ok, mysql-client sudah dipasang. Sekarang jalankan mysql-client.
Perintahnya adalah : mysql -h host - u user -p
bloon@ubuntu:#mysql -h 127.0.0.1 -u root -p
Welcome to the MySQL monitor. -
Jika sudah bisa masuk dengan akses full, sekarang buat user. Ada beberapa cara, namun berikut ini adalah yang penulis anggap paling mudah.
mysql> CREATE USER bego @'localhost IDENTIFIED BY bego_pass ;
mysql> GRANT ALL PRIVILEGES ON . TO bego @'localhost WITH GRANT OPTION;
mysql> CREATE USER bloon @'% IDENTIFIED BY bloon_pass ;
mysql> GRANT ALL PRIVILEGES ON . TO bloon @'% WITH GRANT OPTION;
mysql> CREATE USER ndableg @'localhost ;
mysql> GRANT RELOAD,PROCESS ON . TO admin @'localhost ;
mysql> CREATE USER blee @'localhost ;
user bego hanya bisa masuk dari localhost ( bego @ localhost ) dengan akses SU
user bloon bisa masuk dari mana saja ( bloon @ % ) dengan akses SU
user ndableg hanya bisa masuk dari localhost dengan akses terbatas, RELOAD dan PROCCESS
user blee hanya bisa di akses dari localhost namun belum diaktifkan. Bisa dilakukan lain waktu
7. Test user. Buka terminal baru (ctrl+shift+t)
root@us-djafa:/home/djafa# mysql -h 192.168.18.131 -u bloon -p
Enter password:
Welcome to the MySQL monitor.
mysql>
Alhamdulillah proses penambahanMySQL user selesai