修改表名
SELECT
CONCAT(
'ALTER TABLE ',
table_name,
' RENAME TO b_',
substring( table_name, 2 ),
';'
)
FROM
information_schema.TABLES
WHERE
table_name LIKE 'a_%'; 修改表名
SELECT
CONCAT(
'ALTER TABLE ',
table_name,
' RENAME TO b_',
substring( table_name, 2 ),
';'
)
FROM
information_schema.TABLES
WHERE
table_name LIKE 'a_%'; 直接帖方法
$gps_data = [
[119.182468,34.603796],
[119.182635,34.603347],
[119.182743,34.603370],
[119.182575,34.603846].
];
// 获取GPS中心点坐标
function getGpsCenter($gps_data = [])
{
if (!is_array($gps_data)) return false;
$num_coords = count($gps_data);
$X = 0.0;
$Y = 0.0;
$Z = 0.0;
foreach ($gps_data as $val)
{
#$lon = $coord[1] * pi() / 180;
$lng = deg2rad($val[0]);
#$lat = $coord[0] * pi() / 180;
$lat = deg2rad($val[1]);
$a = cos($lat) * cos($lng);
$b = cos($lat) * sin($lng);
$c = sin($lat);
$X += $a;
$Y += $b;
$Z += $c;
}
$X /= $num_coords;
$Y /= $num_coords;
$Z /= $num_coords;
$lng = atan2($Y, $X);
$hyp = sqrt($X * $X + $Y * $Y);
$lat = atan2($Z, $hyp);
#return array($lat * 180 / pi(), $lon * 180 / pi());
return array(rad2deg($lng), rad2deg($lat));
} 终止以下程序:nginx、apache、mysql、php-fpm、ftp
/etc/init.d/nginx stop
/etc/init.d/httpd stop
/etc/init.d/mysqld stop
/etc/init.d/php-fpm stop
/etc/init.d/vsftpd stop
查看磁盘分区
fdisk -l
Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008d73a
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 104855551 52426752 83 Linux
Disk /dev/vdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
磁盘分区
fdisk /dev/vdb
格式化磁盘
mkfs.ext4 /dev/vdb
挂载磁盘
mount /dev/vdb /home
查看磁盘空间
df -lh
设置重启服务器后自动挂载
vi /etc/fstab
插入一行/dev/vdb /home ext4 defaults 0 0
取消挂载umount /dev/vdb
若想直接直接格式化数据盘,也可以使用mkfs.ext4 /dev/vdb 格式化整个数据盘,然后再进行挂载
查看分区情况
fdisk -l
磁盘分区
fdisk /dev/sda (过程略,这里只建了一个分区)
再查看一下分区
fdisk -l
创建物理分卷
pvcreate /dev/sda1
查看一下当前卷组情况
vgdisplay
这里Free PE / Size 0/0 表明没有可用的扩展空间
查看一下当前卷组
vgscan
查询lv
lvdisplay
查看磁盘大小
df -l
扩展逻辑卷 (根目录"/"的挂载点) 由 lvdisplay 获取
lvextend -L +8G /dev/vg_cloud/vg_root
resize2fs -f /dev/vg_cloud/lv_root
(初始化文件系统)
1.上传文件到网站目录
.nuxt
static
nuxt.config.js
package.json
package-lock.jsoncd /home/wwwroot/test/npm install -productionnpm startpm2 start --name 'test' npm -- run startpm2 save