您正在查看: Surou 发布的文章

ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

执行命令查看输出log

mysqld --console
D:\Program Files\mysql-8.0.19-winx64>mysqld --console
2020-04-03T03:29:17.907577Z 0 [System] [MY-010116] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) starting as process 4772
2020-04-03T03:29:17.909125Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2020-04-03T03:29:19.799340Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-03T03:29:19.819720Z 0 [System] [MY-010931] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.19'  socket: ''  port: 0  MySQL Community Server - GPL.
2020-04-03T03:29:19.822756Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2020-04-03T03:29:19.825137Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-04-03T03:29:19.878167Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2020-04-03T03:29:20.525948Z 0 [System] [MY-010910] [Server] D:\Program Files\mysql-8.0.19-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.

关键错误

TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS

解决方案

修改my.ini,添加shared-memory

2059 – 身份验证插件’caching_sha2_password’-navicat连接异常

这个问题是由于我的MySQL的的的更新至8版本以上了,在安装的时候我并没有指定用户登入密码加密方式,所以默认被设置为caching_sha2_password
解决方法:

mysql> show variables like 'default_authentication_plugin';
Variable_name Value
default_authentication_plugin caching_sha2_password

查看本地mysql用户的信息

mysql> select host,user,plugin from mysql.user;
host user plugin
localhost mysql.infoschema caching_sha2_password
localhost mysql.session caching_sha2_password
localhost mysql.sys caching_sha2_password
localhost root caching_sha2_password

注意 caching_sha2_password, 只修改root的密码加密方式就可以了

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
mysql> select host,user,plugin from mysql.user;
host user plugin
localhost mysql.infoschema caching_sha2_password
localhost mysql.session caching_sha2_password
localhost mysql.sys caching_sha2_password
localhost root mysql_native_password

goland: x86_64-pc-cygwin/bin/ld: cannot find -lmingwex cannot find -lmingw32

使用tdm-gcc
https://jmeubank.github.io/tdm-gcc/download/
然后再系统环境变量path里把tdragon的位置上移到cygwin上面,
让系统调用gcc时先识别tdragon的gcc,或者直接把cygwin的环境路径直接删除了,
或者直接从goland里的settings->Go->GoPath里添加tdragon的路径,如下图

EOS dump 以及 ubuntu设置coredump

EOS 编译Debug

./scripts/eosio_build.sh -o Debug

ubuntu设置coredump

sudo sysctl -w kernel.core_pattern=/corefiles/core.%p.%e
sudo mkdir /corefiles
sudo chmod -R 777 /corefiles
ulimit -c unlimited

nodeos异常退出时,就会在/corefiles/生成dump文件

EOS account下的ram_quota与ram_bytes有什么关系

查看插件返回(github)

 rm.get_account_limits( result.account_name, result.ram_quota, result.net_weight, result.cpu_weight );

查看资源设置(github)

set_resource_limits( res_itr->owner, res_itr->ram_bytes + ram_gift_bytes, net, cpu );

结论

ram_bytes是实际买的RAM 大小,ram_quota 是加上了 赠送的ram_gift_bytes(等于1400)(github)

验证

cleos -u https://api.eoslaomao.com get account bcskillsurou

返回

memory:
     quota:     4.348 KiB    used:      3.49 KiB

查看账户资源表

cleos -u https://api.eoslaomao.com get table eosio bcskillsurou userres

返回

{
  "rows": [{
      "owner": "bcskillsurou",
      "net_weight": "0.0046 EOS",
      "cpu_weight": "0.0147 EOS",
      "ram_bytes": 3052
    }
  ],
  "more": false,
  "next_key": ""
}

计算
quota 与 ram_bytes差值等于 1400,与ram_gift_bytes值一致。