在海之舟大資料平臺上搭建mysql+php開發平臺

wxh585發表於2019-10-10


海之舟伺服器作業系統基於國產arm64,3399cpu,分a版,b版,a版內建了大量軟體,開發介面範例。

作業系統是個.img的檔案,在windows7下刷入tf卡,開機即可啟動。啟動後ssh登陸,操作介面如下。

配置檔案設定開機啟動

root@bigdataA:/home/zs# nano /etc/rc.local

su - zs -c’/md1/apache-tomcat-8.5.35/bin/startup.sh’

#sleep 5

#su - zs -c’pgxc_ctl -c /home/zs/pgxc_ctl/pgxc_ctl.conf start all’

#/etc/init.d/apache2 start

#/etc/init.d/mysql start

#/etc/init.d/bind9 start

#/etc/init.d/postgresql start

#/etc/init.d/vsftpd start

#/etc/init.d/xinetd start

#/etc/init.d/ntp start

exit 0


/etc/init.d/apache2 start

/etc/init.d/mysql start

前的#去掉,mysql,apache2,即開機自動啟動,


root@bigdataA:/home/zs# netstat -an

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN

tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN

tcp 0 256 192.168.1.125:22 192.168.1.6:49733 ESTABLISHED

tcp6 0 0 :::80 ::? LISTEN

tcp6 0 0 :::22 ::? LISTEN

udp 0 0 192.168.1.125:123 0.0.0.0:*

udp 0 0 127.0.0.1:123 0.0.0.0:*

udp 0 0 0.0.0.0:123 0.0.0.0:*

udp6 0 0 fe80::a8c4:51ff:fe3:123 ::?

udp6 0 0 ::1:123 ::?

udp6 0 0 :::123 ::?

檢視啟動情況,80,3306,為apache.mysql的埠。自動啟動正常。在瀏覽器中輸入:

http://192.168.1.125/a.php

顯示php 正常。

修改/var/www/html/下的檔案即可進行php開發。


以下進入資料庫

root@bigdataA:/home/zs# mysql -v

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 39

Server version: 10.1.41-MariaDB-0+deb9u1 Debian 9.9


Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.


Reading history-file /root/.mysql_history

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

切換資料庫

MariaDB [(none)]> use mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Database changed

MariaDB [mysql]>

MariaDB [mysql]> SHOW DATABASES;--------------

SHOW DATABASES

±-------------------+

| Database |

±-------------------+

| information_schema |

| mysql |

±-------------------+

2 rows in set (0.00 sec)


MariaDB [mysql]>

MariaDB [mysql]> CREATE DATABASE example;

CREATE DATABASE example


Query OK, 1 row affected (0.00 sec)


MariaDB [mysql]> SHOW DATABASES;


SHOW DATABASES


±-------------------+

| Database |

±-------------------+

| example |

| information_schema |

| mysql |

±-------------------+

3 rows in set (0.00 sec)


MariaDB [mysql]> use example;

MariaDB [example]>CREATE TABLE student (id int,name varchar(20));


CREATE TABLE student (id int,name varchar(20))


Query OK, 0 rows affected (0.11 sec)


常用命令:

#pwd

/home/zs

root@bigdataA:/home/zs# cd /root

root@bigdataA:~# ls

檢視網路配置

root@bigdataA:~# ifconfig -a

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.1.125 netmask 255.255.255.0 broadcast 192.168.1.255

inet6 fe80::a8c4:51ff:fe3e:aeda prefixlen 64 scopeid 0x20

ether aa:c4:51:3e:ae:da txqueuelen 1000 (Ethernet)

RX packets 4304 bytes 282205 (275.5 KiB)

RX errors 0 dropped 3683 overruns 0 frame 0

TX packets 335 bytes 35961 (35.1 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

device interrupt 24


lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128 scopeid 0x10

loop txqueuelen 1 (Local Loopback)

RX packets 8 bytes 490 (490.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 8 bytes 490 (490.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500

ether 28:ed:e0:62:54:0c txqueuelen 1000 (Ethernet)

RX packets 0 bytes 0 (0.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 0 bytes 0 (0.0 B)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


root@bigdataA:~#

可看到預置的軟體,啟用即可。

root@bigdataA:/home/zs# nano /etc/rc.local

su - zs -c’/md1/apache-tomcat-8.5.35/bin/startup.sh’

#sleep 5

#su - zs -c’pgxc_ctl -c /home/zs/pgxc_ctl/pgxc_ctl.conf start all’

#/etc/init.d/apache2 start

#/etc/init.d/mysql start

#/etc/init.d/bind9 start

#/etc/init.d/postgresql start

#/etc/init.d/vsftpd start

#/etc/init.d/xinetd start

#/etc/init.d/ntp start

exit 0


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23102655/viewspace-2659319/,如需轉載,請註明出處,否則將追究法律責任。

相關文章