MySQL 5.7.27创建用户并授权

$ mysql -u root -p

mysql> use mysql;

mysql> select Host,User from mysql.user;

# 创建用户并设置密码
mysql> create user "wordpress" identified by "password";

# MySQL 8使用如下命令
# mysql> create user "wordpress" identified with mysql_native_password by "password";

#更改用户访问是外网访问还是只能本地访问
mysql> update mysql.user set Host="localhost" where User="wordpress";

# 更新密码,5.7的数据库使用'authentication_string'字段替代了'Password'字段
mysql> update user set authentication_string=password("pass") where User="wordpress" and Host="localhost";

# MySQL 8 不能使用上面的命令修改密码,只能在创建的时候设置密码,可以先删除再创建
# drop user "wordpress";

# 如果没这一行可能也会报一个错误,因此需要运行这一行
mysql> update user set plugin="mysql_native_password";

mysql> select Host,User from mysql.user;

# 授予用户访问Wordpress数据库的权限
mysql> grant all privileges on wordpress.* to "wordpress"@"localhost" identified by "pass";

# MySQL 8使用如下命令
# mysql> grant all privileges on wordpress.* to "wordpress";

# 刷新权限
mysql> flush privileges;

参考链接


macOS Catalina卸载XQuartz

目前`macOS`使用`XQuartz`实现`X11`相关的`API`,需要卸载的时候,执行如下命令即可:

$ sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
 
$ sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
 
$ sudo pkgutil --forget org.macosforge.xquartz.pkg

参考链接


macOS卸载xquartz

macOS Catalina卸载CUDA

对于`CUDA 8.0`建议优先执行`/Developer/NVIDIA/CUDA-8.0/bin/uninstall_cuda_8.0.pl`,进行卸载操作。

对于`CUDA 9.0`建议优先执行`/Developer/NVIDIA/CUDA-9.0/bin/uninstall_cuda_9.0.pl`,进行卸载操作。

当执行上面的脚本失败的时候,删除以下两个文件路径即可卸载该驱动:

/usr/local/cuda
/Library/Frameworks/CUDA.framework

参考链接


Mac卸载CUDA

Android Studio 3.5.1配置NDK路径

早期版本的Android Studio在全局配置NDK的路径信息,但是从Android Studio 3.4版本开始,NDK的路径信息被转移到Project Structure部分去配置了,这变成了一个工程相关的配置,每个工程可以单独配置独立的NDKSDK版本。

具体操作如下图:

继续阅读Android Studio 3.5.1配置NDK路径

macOS Catalina(10.15)解决阻止程序运行“macOS无法验证此App不包含恶意软件”

默认情况下,macOS Catalina的应用程序,必须交由苹果进行一系列安全认证,否则会在默认情况下被阻止运行。未经过安全认证的应用运行的时候,会弹出如下提示

继续阅读macOS Catalina(10.15)解决阻止程序运行“macOS无法验证此App不包含恶意软件”

主机同步服务功能用不上,如何禁用?

现在家庭电脑很多,并不是为了办公用的,纯属娱乐,在使用电脑时,很多东西都用不上,长期下来很影响运行,可是很多不会关闭,甚至都删除不了,让人束手无策,近来有用户反映了Win10系统主机同步服务的问题。

Win10系统中有一个主机同步服务,很多朋友可能不太明白干嘛用的,实际上主机同步服务主要作用于Win10系统数据同步,比如Onedrive就要用到这个服务,当然如果你不使用Onedrive也可以禁用这个服务,当然在服务中我们去禁用时会出现“参数错误”的提示,下面讲述一下禁用方法。

继续阅读主机同步服务功能用不上,如何禁用?

利用git format-patch和git send-email通过新浪邮箱把修改的patch文件发送给ipfire-devel

1. 下载源码

$ git clone git://git.ipfire.org/ipfire-2.x.git

2. 设置git用户的邮箱和姓名

$ git config --global user.email "email@sina.com"

$ git config --global user.name "name"

3. 修改文件后commit

$ git commit -m "Simple Chinese language"

commit 74179cda78a4fcbdbb94e0bb8e5ce0c03f38b5fc (HEAD -> master)
Author: name <email@sina.com>
Date:   Mon Oct 7 16:17:03 2019 +0800

     Simple Chinese language

4. 生成patch文件

$ git format-patch -1 74179cda78a4fcbdbb94e0bb8e5ce0c03f38b5fc --stdout > zh_language.patch

5. 设置git的smtp参数

$ git config --global sendemail.from "name <email@sina.com>"

$ git config --global sendemail.smtpServer smtp.sina.com

$ git config --global sendemail.smtpUser email@sina.com

# 邮箱的实际登录密码
$ git config --global sendemail.smtpPass pass

# 新浪邮箱要求登陆认证之后才能发送邮件
$ git config --global sendemail.smtpAuth "LOGIN"

# 新浪邮箱建议使用BASE64编码
$ git config --global sendemail.transferEncoding "BASE64"

$ git config --global sendemail.smtpEncryption tls

$ git config --global sendemail.chainReplyTo false

$ git config --global sendemail.smtpServerPort 587

6. 发送邮件给development@lists.ipfire.org

$ git send-email zh_language.patch --smtp-debug=1

输入ipfire-devel邮箱地址development@lists.ipfire.org, 回车两次就完成.

7.查看是否提交成功

发送邮件过一段时间后,在这里能查到https://lists.ipfire.org/mailman/listinfo/development,不同的模块有对应的邮件列表地址。

8.常见错误

测试中发现有时候 git apply 应用git format-patch创建的补丁文件的时候,可能报告如下错误:

git apply patch doesn't work: no such file or directory

也就是应用补丁的时候会失败,造成这种情况的原因一般是同一份代码配置了多个远程仓库导致的。

比如我同步了一份代码到自己的服务器上,这样就容易出现这种情况。

解决方法一般是克隆一份独立的代码,单独在这个独立的代码中创建代码补丁。

参考链接


使用VNC Viewer连接树莓派4B远程桌面提示错误“Cannot currently show the dekstop”

使用`VNC Viewer`连接`树莓派4B`远程桌面提示错误“`Cannot currently show the dekstop`”,如下图: 继续阅读使用VNC Viewer连接树莓派4B远程桌面提示错误“Cannot currently show the dekstop”