
Moxa Technologies Co., Ltd.
SW Spec.
文件編號:
版本:
頁次:9/13
3.2. MySQL Client
3.2.1. Install MySQL Client
If you wan to run MySQL client on UC, please follow the statements bellow.
1. Using command ‘upramdisk’ to mount a ram disk at ‘/mnt/ramdisk’ and then copy
‘mysql-client-5.1.23.tgz’ to ‘/mnt/ramdisk’
2. After that, untar ‘mysql-client-5.1.23.tgz’ and enter ‘mysql-server’ directory and run ‘install.sh’
script.
3. You will see three functions after running install script.
i. Function 1 will install MySQL client into embedded flash.
ii. Function 2 will uninstall MySQL client from embedded flash.
iii. Function 3 will leave the install script immediately.
Choosing function 1 to install MySQL client, after seeing “MySQL client install success”, you have
MySQL client on UC-7400 PLUS series box. MySQL client will occupy about 500KB embedded
flash space.
192.168.30.126 - Putty
root@Moxa:/mnt/ramdisk/mysql-client-5.1.23# ./install.sh
Press the number:
1. Install MySQL client and MySQL client library.
2. Uninstall MySQL client and MySQL client library.
3. Exit.
1
MySQL install success!
root@Moxa:/mnt/ramdisk/mysql-client-5.1.23#
3.2.2. Test MySQL Client
1. If you have a running MySQL server at localhost, you can simply type ‘mysql’ to connect to
localhost MySQL server and make some SQL query.
192.168.30.126 - Putty
mysql> use mysql
Database changed
mysql> select user,host from user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| | Moxa |
| root | Moxa |
| | localhost |
| root | localhost |
+------+-----------+
5 rows in set (0.00 sec)
mysql>
2. If you have a remote MySQL server, make sure you have privilege to connect to remote MySQL
server, and then use this command to connect ‘mysql –h remote_server_ip –u user -p’
192.168.30.126 - Putty
root@Moxa# mysql -h localhost -u root
Comentarios a estos manuales