docker安装MySQL 8.0及初始化错误处理
- [root@docker vagrant]# docker images
- REPOSITORY TAG IMAGE ID CREATED SIZE
- centos7 latest 7d0b68af5a06 days ago 694MB
- [root@docker vagrant]# docker run -d -v /vagrant/mysql_soft:/opt/mysql -v /vagrant/data1:/data -v /etc/hosts:/etc/hosts -p2222: --cap-add=NET_ADMIN --name c1 -h docker centos7
- fbf17e3f6aa8324b8d494aa0211122f5d735bf6f648a99b6632ae2be5be996da
- [root@docker vagrant]# docker ps -a
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- fbf17e3f6aa8 centos7 "/usr/bin/supervisor…" seconds ago Up seconds (healthy) 0.0.0.0:->/tcp c1
- 103f318448c9 centos7 "/usr/bin/supervisor…" minutes ago Exited () minutes ago node1
- [root@docker vagrant]# docker rm container 103f318448c9
- 103f318448c9
- Error: No such container: container
- [root@docker vagrant]# docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- fbf17e3f6aa8 centos7 "/usr/bin/supervisor…" seconds ago Up seconds (healthy) 0.0.0.0:->/tcp c1
- [root@docker vagrant]# ssh root@172.17.0.2
- root@172.17.0.2's password:
- Last login: Wed Jun :: from 172.17.0.1
- [root@docker ~]# df -h
- Filesystem Size Used Avail Use% Mounted on
- /dev/mapper/docker-:--60de86a769f75e2e96c849e76f1b3de10ac8c8d9985597ff3f758070edada54d 10G 682M .4G % /
- tmpfs 64M 64M % /dev
- tmpfs 497M 497M % /sys/fs/cgroup
- none 612G 242G 370G % /data
- /dev/mapper/centos-root .4G .1G .3G % /etc/hosts
- shm 64M 64M % /dev/shm
- tmpfs 497M 497M % /proc/scsi
- tmpfs 497M 497M % /sys/firmware
Download and extract MySQL software.
- [root@docker ~]# cd /vagrant/mysql_soft
- [root@docker mysql_soft]# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
- [root@docker mysql_soft]# cd /opt/mysql
- [root@docker mysql]# ls -l
- total
- -rwxrwxrwx Mar : mysql-5.7.-linux-glibc2.-x86_64.tar.gz
- -rwxrwxrwx Jun : mysql-8.0.-linux-glibc2.-x86_64.tar.gz
- [root@docker mysql]# tar -zxf mysql-8.0.-linux-glibc2.-x86_64.tar.gz
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/libcrypto.so: Cannot create symlink to `libcrypto.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/libmysqlclient.so: Cannot create symlink to `libmysqlclient.so.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/libmysqlclient.so.: Cannot create symlink to `libmysqlclient.so.21.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/libssl.so: Cannot create symlink to `libssl.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/plugin/libssl.so.1.0.: Cannot create symlink to `../../lib/libssl.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/plugin/libcrypto.so.1.0.: Cannot create symlink to `../../lib/libcrypto.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/plugin/debug/libssl.so.1.0.: Cannot create symlink to `../../../lib/libssl.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/lib/plugin/debug/libcrypto.so.1.0.: Cannot create symlink to `../../../lib/libcrypto.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/bin/libssl.so.1.0.: Cannot create symlink to `../lib/libssl.so.1.0.': Protocol error
- tar: mysql-8.0.-linux-glibc2.-x86_64/bin/libcrypto.so.1.0.: Cannot create symlink to `../lib/libcrypto.so.1.0.': Protocol error
- tar: Exiting with failure status due to previous errors
Check absent "libxxx.so" then install them untill there're no "not found" results.
- [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld.sh
- ldd: /usr/local/mysql/bin/mysqld.sh: No such file or directory
- [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
- linux-vdso.so. => (0x00007fff57cca000)
- libpthread.so. => /lib64/libpthread.so. (0x00007f57bc85d000)
- libaio.so. => not found
- libnuma.so. => not found
- libcrypt.so. => /lib64/libcrypt.so. (0x00007f57bc625000)
- libssl.so.1.0. => not found
- libcrypto.so.1.0. => not found
- libdl.so. => /lib64/libdl.so. (0x00007f57bc420000)
- librt.so. => /lib64/librt.so. (0x00007f57bc217000)
- libstdc++.so. => /lib64/libstdc++.so. (0x00007f57bbf10000)
- libm.so. => /lib64/libm.so. (0x00007f57bbc0e000)
- libgcc_s.so. => /lib64/libgcc_s.so. (0x00007f57bb9f7000)
- libc.so. => /lib64/libc.so. (0x00007f57bb62a000)
- /lib64/ld-linux-x86-.so. (0x00007f57bca7f000)
- libfreebl3.so => /lib64/libfreebl3.so (0x00007f57bb427000)
- [root@docker mysql]# yum install -y libaio numactl libssl libcrypto
- -- Omitted
- [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
- linux-vdso.so. => (0x00007fff05f82000)
- libpthread.so. => /lib64/libpthread.so. (0x00007fc18aca3000)
- libaio.so. => /lib64/libaio.so. (0x00007fc18aaa0000)
- libnuma.so. => /lib64/libnuma.so. (0x00007fc18a894000)
- libcrypt.so. => /lib64/libcrypt.so. (0x00007fc18a65d000)
- libssl.so.1.0. => not found
- libcrypto.so.1.0. => not found
- libdl.so. => /lib64/libdl.so. (0x00007fc18a458000)
- librt.so. => /lib64/librt.so. (0x00007fc18a24f000)
- libstdc++.so. => /lib64/libstdc++.so. (0x00007fc189f48000)
- libm.so. => /lib64/libm.so. (0x00007fc189c46000)
- libgcc_s.so. => /lib64/libgcc_s.so. (0x00007fc189a2f000)
- libc.so. => /lib64/libc.so. (0x00007fc189662000)
- /lib64/ld-linux-x86-.so. (0x00007fc18aec5000)
- libfreebl3.so => /lib64/libfreebl3.so (0x00007fc18945f000)
- [root@docker mysql]# find / -name libssl.so.1.0.
- /opt/mysql/mysql-8.0.-linux-glibc2.-x86_64/lib/libssl.so.1.0.
- [root@docker mysql]# cp /opt/mysql/mysql-8.0.-linux-glibc2.-x86_64/lib/libssl.so.1.0. /usr/lib64
- [root@docker mysql]# find / -name libcrypto.so.1.0.
- /opt/mysql/mysql-8.0.-linux-glibc2.-x86_64/lib/libcrypto.so.1.0.
- [root@docker mysql]# cp /opt/mysql/mysql-8.0.-linux-glibc2.-x86_64/lib/libcrypto.so.1.0. /usr/lib64
- [root@docker mysql]# ldd /usr/local/mysql/bin/mysqld
- linux-vdso.so. => (0x00007fff13ffe000)
- libpthread.so. => /lib64/libpthread.so. (0x00007f156dbc3000)
- libaio.so. => /lib64/libaio.so. (0x00007f156d9c0000)
- libnuma.so. => /lib64/libnuma.so. (0x00007f156d7b4000)
- libcrypt.so. => /lib64/libcrypt.so. (0x00007f156d57d000)
- libssl.so.1.0. => /lib64/libssl.so.1.0. (0x00007f156d30d000)
- libcrypto.so.1.0. => /lib64/libcrypto.so.1.0. (0x00007f156cf25000)
- libdl.so. => /lib64/libdl.so. (0x00007f156cd21000)
- librt.so. => /lib64/librt.so. (0x00007f156cb18000)
- libstdc++.so. => /lib64/libstdc++.so. (0x00007f156c811000)
- libm.so. => /lib64/libm.so. (0x00007f156c50f000)
- libgcc_s.so. => /lib64/libgcc_s.so. (0x00007f156c2f8000)
- libc.so. => /lib64/libc.so. (0x00007f156bf2b000)
- /lib64/ld-linux-x86-.so. (0x00007f156dde5000)
- libfreebl3.so => /lib64/libfreebl3.so (0x00007f156bd28000)
Make required directory and create soft link.
- [root@docker mysql]# mkdir -p /data/mysql/mysql3306/{data,logs,tmp}
- [root@docker mysql]# ln -sv /opt/mysql/mysql-8.0.-linux-glibc2.-x86_64 /usr/local/mysql
- ‘/usr/local/mysql’ -> ‘/opt/mysql/mysql-8.0.-linux-glibc2.-x86_64’
Create mysql group & user.
- [root@docker mysql]# userdel mysql
- [root@docker mysql]# groupadd mysql
- [root@docker mysql]# useradd -g mysql -s /sbin/nologin -d /usr/local/mysql -MN mysql
Modify directory privilege.
- [root@docker mysql]# cd /usr/local
- [root@docker local]# chown -R mysql.mysql mysql
Modify environment variable.
- [root@docker local]# echo "export PATH=$PATH:/usr/local/mysql/bin" >> ~/.bash_profile
- [root@docker local]# source ~/.bash_profile
- [root@docker local]# echo $PATH
- /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin
Prepare a suitable my.cnf in docker and then copy it to specific path.
- [root@docker local]# cp /opt/mysql/my.cnf /data/mysql/mysql3306/my3306.cnf
Initialize MySQL db.
- [root@docker local]# mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf --initialize
- mysqld: [Warning] World-writable config file '/data/mysql/mysql3306/my3306.cnf' is ignored.
- --23T16::.446641Z [System] [MY-] [Server] mysqld (mysqld 8.0.) initializing of server in progress as process
- --23T16::.528638Z [ERROR] [MY-] [Server] Can't find error-message file '/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
- --23T16::.804315Z [ERROR] [MY-] [Server] --initialize specified but the data directory has files in it. Aborting.
- --23T16::.804363Z [ERROR] [MY-] [Server] Aborting
- --23T16::.010408Z [System] [MY-] [Server] mysqld: Shutdown complete (mysqld 8.0.) MySQL Community Server - GPL.
- [root@docker ~]# cd /data/mysql/mysql3306/data -- There're no files in the directory,why does it show the existent error?Let's see below.
- [root@docker data]# ls -la
- total
- drwxrwxrwx mysql mysql Jun : .
- drwxrwxrwx mysql mysql Jun : ..
I change the way of initialization.
- [root@docker data]# mysqld --basedir=/usr/local/mysql --datadir=/data/mysql/mysql3306/data --user=mysql --initialize
- --23T17::.792594Z [System] [MY-] [Server] mysqld (mysqld 8.0.) initializing of server in progress as process
- --23T17::.887954Z [Warning] [MY-] [Server] Setting lower_case_table_names= because file system for /data/mysql/mysql3306/data/ is case insensitive
- mbind: Operation not permitted
- --23T17::.669761Z [Note] [MY-] [Server] A temporary password is generated for root@localhost: o/>k*hqxn1T=
- --23T17::.807974Z [System] [MY-] [Server] mysqld (mysqld 8.0.) initializing of server has completed
- [root@docker etc]# ps aux | grep mysqld
- root 0.0 0.0 pts/ SN+ : : grep --color=auto mysqld
Start mysqld but failed.
- [root@docker etc]# mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf &
- []
- [root@docker etc]# mysqld: [Warning] World-writable config file '/data/mysql/mysql3306/my3306.cnf' is ignored.
- --23T17::.345108Z [System] [MY-] [Server] mysqld (mysqld 8.0.) starting as process
- --23T17::.346090Z [ERROR] [MY-] [Server] Can't find error-message file '/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
- --23T17::.357718Z [Warning] [MY-] [Server] Setting lower_case_table_names= because file system for /data/ is case insensitive
- --23T17::.358228Z [ERROR] [MY-] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
- --23T17::.358263Z [ERROR] [MY-] [Server] Aborting
- --23T17::.362713Z [System] [MY-] [Server] mysqld: Shutdown complete (mysqld 8.0.) MySQL Community Server - GPL.
- ^C
- []+ Exit mysqld --defaults-file=/data/mysql/mysql3306/my3306.cnf
The my3306.cnf cannot be world-writable,so I copy it to "/tmp" and start mysqld again.
- [root@docker etc]# cp /data/mysql/mysql3306/my3306.cnf /tmp
- [root@docker etc]# cd /tmp
- [root@docker tmp]# ls -l | grep my3306.cnf
- -rwxr-xr-x root root Jun : my3306.cnf
- [root@docker tmp]# mysqld --defaults-file=/tmp/my3306.cnf &
- []
- [root@docker tmp]# ps aux | grep mysqld
- root 0.0 0.0 pts/ SN+ : : grep --color=auto mysqld
- []+ Exit mysqld --defaults-file=/tmp/my3306.cnf
- [root@docker etc]# tail /data/mysql/mysql3306/data/error.log
- --24T01::03.732865+: [Warning] [MY-] [Server] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
- --24T01::03.735145+: [Warning] [MY-] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
- --24T01::03.736465+: [System] [MY-] [Server] mysqld (mysqld 8.0.) starting as process
- mbind: Operation not permitted
- --24T01::04.184074+: [ERROR] [MY-] [InnoDB] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size pages (rounded down to MB) than specified in the .cnf file: initial pages, max (relevant if non-zero) pages!
- --24T01::04.184868+: [ERROR] [MY-] [InnoDB] InnoDB: Plugin initialization aborted with error Generic error.
- --24T01::04.810086+: [ERROR] [MY-] [Server] Failed to initialize DD Storage Engine
- --24T01::04.810840+: [ERROR] [MY-] [Server] Data Dictionary initialization failed.
- --24T01::04.810961+: [ERROR] [MY-] [Server] Aborting
- --24T01::04.828841+: [System] [MY-] [Server] mysqld: Shutdown complete (mysqld 8.0.) MySQL Community Server - GPL.
It still has problem 'cause size of "./ibdata1" is incompatible with the parameter in "my3306.cnf".
- [root@docker data]# ls -l ibdata1
- -rwxrwxrwx mysql mysql Jun : ibdata1
- [root@docker data]# cat /tmp/my3306.cnf | grep innodb_data_file_path
- innodb_data_file_path =ibdata1:100M:autoextend # ibdata1:12M:autoextend
- [root@docker data]# vim /tmp/my3306.cnf | grep innodb_data_file_path
- [root@docker data]# cat /tmp/my3306.cnf | grep innodb_data_file_path
- innodb_data_file_path =ibdata1:12M:autoextend # ibdata1:12M:autoextend
After I started mysqld several seconds later,the process down again at once.
- [root@docker etc]# mysqld --defaults-file=/tmp/my3306.cnf &
- []
- [root@docker etc]# ps aux|grep mysqld
- mysql 38.0 3.1 pts/ SNl : : mysqld --defaults-file=/tmp/my3306.cnf
- root 0.0 0.0 pts/ SN+ : : grep --color=auto mysqld
- [root@docker etc]# ps aux|grep mysqld
- root 0.0 0.0 pts/ SN+ : : grep --color=auto mysqld
- [root@docker etc]#
- [root@docker data]# tail - error.log
- --24T01::30.177384+: [Warning] [MY-] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
- --24T01::30.179005+: [System] [MY-] [Server] mysqld (mysqld 8.0.) starting as process
- mbind: Operation not permitted
- --24T01::33.215591+: [ERROR] [MY-] [Server] Different lower_case_table_names settings for server ('') and data dictionary ('').
- --24T01::33.216211+: [ERROR] [MY-] [Server] Data Dictionary initialization failed.
- --24T01::33.216289+: [ERROR] [MY-] [Server] Aborting
- --24T01::34.839683+: [System] [MY-] [Server] mysqld: Shutdown complete (mysqld 8.0.) MySQL Community Server - GPL.
The error shows that the value is not equal between "lower_case_table_names" and dictionary.
- [root@docker data]# cat /opt/mysql/my.cnf|grep lower_case_table_names
- lower_case_table_names = #
- [root@docker data]# cat /tmp/my3306.cnf | grep lower_case_table_names
- lower_case_table_names = #
- [root@docker data]# vim /tmp/my3306.cnf
- [root@docker data]# cat /tmp/my3306.cnf | grep lower_case_table_names
- lower_case_table_names = #
After I've modified my3306.cnf,it seems no error occurs now.
- [root@docker data]# tail - error.log
- --24T01::20.035831+: [Warning] [MY-] [Server] 'user' entry 'mysql.infoschema@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.035971+: [Warning] [MY-] [Server] 'user' entry 'mysql.session@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.036064+: [Warning] [MY-] [Server] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.036160+: [Warning] [MY-] [Server] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.036898+: [Warning] [MY-] [Server] 'db' entry 'performance_schema mysql.session@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.037083+: [Warning] [MY-] [Server] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.037268+: [Warning] [MY-] [Server] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.042517+: [Warning] [MY-] [Server] 'tables_priv' entry 'user mysql.session@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.042646+: [Warning] [MY-] [Server] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
- --24T01::20.099046+: [System] [MY-] [Server] mysqld: ready for connections. Version: '8.0.11' socket: '/tmp/mysql.sock' port: MySQL Community Server - GPL.
- [root@docker etc]# ps aux|grep mysqld
- mysql 2.0 9.3 pts/ SNl : : mysqld --defaults-file=/tmp/my3306.cnf
- root 0.0 0.0 pts/ SN+ : : grep --color=auto mysqld
Start mysql client and modify the password generated by initialization.
- [root@docker etc]# mysql
- ERROR (): Access denied for user 'root'@'localhost' (using password: NO)
- [root@docker etc]# mysql -p
- Enter password: -- Use the password which generated by initialization(here is "o/>k*hqxn1T=")
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is
- Server version: 8.0.
- Copyright (c) , , Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> show databases;
- ERROR (HY000): You must reset your password using ALTER USER statement before executing this statement.
- mysql> alter user root@localhost identified by 'Passw0rd';
- Query OK, rows affected (0.11 sec)
- mysql> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | information_schema |
- | mysql |
- | performance_schema |
- | sys |
- +--------------------+
- rows in set (0.20 sec)
- mysql>
- ldd can be used to check if mysqld is missing "libxxx.so" file.Then you can install or copy directly into "/usr/lib64" directory.
- There're many errors in my installation procedure due to inappropriate parameters.
- Because of the vagrant,all the shared directories in docker contains also has the 777 privilege what cause the world-writable issue.
- Since MySQL 5.7,password of root@localhost must be changed while first login.Otherwise,you can do nothing at all.
docker安装MySQL 8.0及初始化错误处理的更多相关文章
- docker 安装 MySQL 8.0
1.查找镜像 查找Docker Hub上的mysql镜像 X230:~$ docker search mysql NAME DESCRIPTION STARS OFFICIAL AUTOMATED m ...
- Docker安装MySQL 8.0并挂载数据及配置文件
安装部署环境 Ubuntu 18.04.3 LTS Docker 19.03.2 MySQL latest(8.0.17) 下载镜像 # docker从仓库中拉取最新版的mysql镜像,如果没加标签的 ...
- centos docker 安装mysql 8.0
centos 版本 CentOS Linux release 7.5.1804 (Core) 内核版本: 3.10.0-862.el7.x86_64 下载最新版mysql docker pull m ...
- Docker学习实践 - Docker安装MySql数据库
Docker安装MySQL数据库 1.Ubuntu安装MySQL安装 (1)安装编译源码需要的包 sudo apt-get install make cmake gcc g++ bison libnc ...
- 使用docker安装mysql和redis
本文介绍在linux下使用docker安装mysql和redis. 原文地址:代码汇个人博客 http://www.codehui.net/info/59.html 测试环境:centos7.6,do ...
- docker 安装mysql mongo
Docker安装Mysql 1.拉取镜像 docker pull mysql/mysql-server 2.运行mysql docker run -d -p : --name [Name] [Imag ...
- windows 系统如何安装 mysql 8.0.15 数据库?
windows 系统如何安装 mysql 8.0.15 数据库? 1. 下载安装包 下载地址:https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0. ...
- docker安装mysql(Baas)
Docker安装mysql 5.7版本 //拉取mysql镜像 docker pull mysql:5.7 下载完成后,在本地镜像列表里查到REPOSITORY为mysql,标签为5.7的镜像. do ...
- 安装Mysql 8.0的艰难体验
背景: Mysql 8.0 以后版本,在性能等方面有了很大提升,而且在自动编号.Timestamp等字段的设置上有了很方便的进步,因此在一年前即开始将原有的基于5.5版本的服务器逐渐向8.0转移.但转 ...
随机推荐
- Angular JS例子 ng-repeat遍历输出
首先要有Angular的插件:然后才开始遍历 :<!DOCTYPE html> <html lang="en"> <head> <meta ...
- C语言入门(一)环境搭建
1. 下载Code::Blocks(源文本编辑器) 2. 下载编译器MinGW(或者下载好自带编译器的codeblocks) http://jingyan.baidu.com/article/c843 ...
- window.frames在不同浏览器中的用法
document.frames 等同于 window.frames,用来取得当前页面内 window 对象的集合. 不支持Firefox,其他浏览器(chrome.opera.IE.360)均支持. ...
- 使用CKRule规则引擎处理多变业务
1, 多变业务 开发系统时,有没有试过下面的情况,如果你试过,那可以考虑一下使用规则引擎了. 序号 问题 举例 1 业务规则来自于一个或多个表格 商店的会员积分表,停车场的计费标准,快递费的计算表,客 ...
- 开发Windows RT平台下的Windows应用商店应用程序的遇到的问题备忘
1. 关于获取Win8开发者许可证的问题: 有一种情况是:如果系统是Win8.0, 那么如果先激活了windows8(用激活工具), 再安装VS2012,那么在新建项目时会提示获取windows8开发 ...
- Python学习系列提升篇------字符串
字符串是python学习中重要的内容,在以后的工作中,对字符串的处理也必少不了.下面总结一下关于字符串学习的经验. 1.1 字符串的连接和合并 用‘ + ’连接,将两个字符串相加. 合并, ...
- 多线程(八)~ThreadLocal、InheritableThreadLocal的使用
通过前面的学习,我们了解了在多线程+成员变量等情况下会出现线程安全的问题.那么解决线程安全问题除了使用synchronize关键字之外,还有另一种常用的解决思路,那就是使用ThreadLocal类,下 ...
- 面试题之----一次完整的HTTP请求过程
当我们在浏览器的地址栏输入 www.linux178.com ,然后回车,回车这一瞬间到看到页面到底发生了什么呢? 以下过程仅是个人理解: 域名解析 --> 发起TCP的3次握手 --> ...
- tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images
当运行mpimg.imread("img.jpg")时,spyder 出现如下错误: ValueError: Only know how to handle extensions: ...
- JavaMelody监控spring、struts
前言 前面讲过了Javamelody的基本配置,如何使用Javamelody来监控JDBC以及SQL. 这里继续讲解一下如何监控struts和spring. 手码不易,转载请注明:xingoo 由于s ...