===== Install dan Konfigurasi =====
opkg install mysql-server
sed -i 's,^datadir.*,datadir = "/srv/mysql",g' /etc/my.cnf
sed -i 's,^tmpdir.*,tmpdir = "/tmp",g' /etc/my.cnf
mkdir -p /srv/mysql
mysql_install_db --force
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
mysqladmin -u root password 'password'
===== Test mysql-server =====
root@Arduino:~
# mysql -uroot -p
Enter password:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
|
test
|
+--------------------+
3 rows
in
set
(0.00 sec)
mysql> exit
bye
===== Flush Prifileges =====
root@WebServer:~
# ps|grep mysqld
13635 root 25848 S /usr/bin/mysqld
13659 root 1492 S grep mysqld
root@WebServer:~
# kill 13635 (PID Number of mysql)
root@WebServer:~
# /etc/init.d/mysqld start
lanjut di edisi TA ane wahaha
kali ini mau coba install mysql di openwrt. Step by Step sebenarnya udah ada di wiki. Ini cuma kopas dan hanya pelengkap blog :p
opkg update
opkg install libpthread libncurses libreadline mysql-server
sed -i 's,^datadir.*,datadir = /srv/mysql,g' /etc/my.cnf
sed -i 's,^tmpdir.*,tmpdir = /tmp,g' /etc/my.cnf
mkdir -p /srv/mysql
mysql_install_db --force
/etc/init.d/mysqld start
/etc/init.d/mysqld enable
mysqladmin -u root password 'new-password'
untuk menjalankan mysql dengan php
opkg update
opkg install php5-mod-mysql
ed -i 's,;extension=mysql.so,extension=mysql.so,g' /etc/php.ini
*note
ketika mencoba untuk melakukan koneksi antara php dan mysql, muncul error
Can’t connect to local MySQL server through socket ‘/tmp’ (146)
solusinya cuma ganti nama host dari locahost ke 127.0.0.1
================ TAMBAHAN ===============
OpenWrt Mysql-Server Install
opkg updateopkg install mysql-server
/usr/bin/mysqld –skip-grant-tables&
mysql -uroot
SET PASSWORD FOR root@’localhost’ = PASSWORD(‘password’);
UPDATE mysql.user SET Password=PASSWORD(‘newpwd’) WHERE User=’root’;
FLUSH PRIVILEGES;
exit
ps |grep mysqld
kill PIDNUMBEROFMYSQL
/etc/init.d/mysqld start
No comments:
Post a Comment