vue Blog 学习笔记 (2) 第三方包

有道翻译接口

有道智云
有道智云注册账号,在左侧导航栏的 “应用管理” 里创建应用。然后创建实例。获取 应用ID应用秘钥

安装第三方包
composer require jellybool/translug

该字段值为空,重新生成数据库

php artisan migrate:refresh --seed
htmlspecialchars() expects parameter 1 to be string, object given
{{ url($article->slug) }}

MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED]

npm run dev 后需要重启 mysql,不知道为什么 mysql 的 pid 文件被删除了。
MySQL server PID file could not be found! [FAILED]

/var/lock/subsys/mysql 什么功能
/etc/init.d/mysqld 文件中指定了

Lock directory for RedHat / SuSE.

lockdir='/var/lock/subsys'
lock_file_path="$lockdir/mysql"

service mysqld start
mysqld_safe A mysqld process already exists

root     20555  0.0  0.1  11772  1568 pts/1    S    11:02   0:00 
/bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data 
--pid-file=/usr/local/mysql/data/izj6cj8sn01c9l2u2e9nhqz.pid

mysql    20664  0.0 45.6 1297672 464392 pts/1  Sl   11:02   0:00 
/usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 
--plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=izj6cj8sn01c9l2u2e9nhqz.err 
--pid-file=/usr/local/mysql/data/izj6cj8sn01c9l2u2e9nhqz.pid

[ERROR] InnoDB: Cannot allocate memory for the buffer pool

The problem is that the server does not have enough memory to allocate for MySQL process. There are a few solutions to this problem.
(1) Increase the physical RAM. Adding 1GB of additional RAM will solve the problem.
(2) Allocate SWAP space. Digital Ocean VPS instance is not configured to use swap space by default. By allocating 512MB of swap space, we were able to solve this problem. To add swap space to your server, please follow the following steps:

杀死 php-fpm
kill -INT cat /usr/local/php7/var/run/php-fpm.pid
启动 php-fpm
/usr/local/php7/sbin/php-fpm

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容