在线等!!!linux服务器连接mysql5.7数据库报错 Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException

以下是服务器上的报错代码
图片说明

>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 1000, active 0, maxActive 500, creating 1

问题就是出在这里.

1,本地项目正常启动,无任何报错,数据库连接正常(使用的都是linux上面的数据库).
图片说明

2,数据库工具使用无任何问题

图片说明

3,下面放出jdbc配置文件和spring配置文件

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://..XXXXXX.:/XXXXXX?useUnicode=true&characterEncoding=UTF-8&useSSL=false
jdbc.username=xxxx
jdbc.password=xxxxx

jdbc.filters=stat
jdbc.maxActive=500
jdbc.initialSize=1
jdbc.maxWait=1000
jdbc.minIdle=10
jdbc.maxIdle=15
jdbc.timeBetweenEvictionRunsMillis=60000
jdbc.minEvictableIdleTimeMillis=300000
jdbc.validationQuery=SELECT 'x'
jdbc.testWhileIdle=true
jdbc.testOnBorrow=false
jdbc.testOnReturn=false
jdbc.maxOpenPreparedStatements=20
jdbc.removeAbandoned=true
jdbc.removeAbandonedTimeout=180
jdbc.logAbandoned=true

spring 配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd">

    <!-- 扫描service包下所有使用注解的类型 -->
    <context:component-scan base-package="com.yoFish.service"/>

    <!-- 配置数据库相关参数properties的属性:${url} -->
    <context:property-placeholder location="classpath:jdbc.properties"/>

    <!-- 阿里 druid 数据库连接池 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" destroy-method="close">
        <!-- 数据库基本信息配置 -->
        <property name="driverClassName" value="${jdbc.driverClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>

        <property name="filters" value="${jdbc.filters}"/>

        <!-- 最大并发连接数 -->
        <property name="maxActive" value="${jdbc.maxActive}"/>

        <!-- 初始化连接数量 -->
        <property name="initialSize" value="${jdbc.initialSize}"/>

        <!-- 配置获取连接等待超时的时间 -->
        <property name="maxWait" value="${jdbc.maxWait}"/>

        <!-- 最小空闲连接数 -->
        <property name="minIdle" value="${jdbc.minIdle}"/>

        <!-- 最大空闲连接数 -->
        <property name="maxIdle" value="${jdbc.maxIdle}"/>

        <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
        <property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}"/>

        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
        <property name="minEvictableIdleTimeMillis" value="${jdbc.minEvictableIdleTimeMillis}"/>

        <property name="validationQuery" value="${jdbc.validationQuery}"/>
        <property name="testWhileIdle" value="${jdbc.testWhileIdle}"/>
        <property name="testOnBorrow" value="${jdbc.testOnBorrow}"/>
        <property name="testOnReturn" value="${jdbc.testOnReturn}"/>
        <property name="maxOpenPreparedStatements" value="${jdbc.maxOpenPreparedStatements}"/>

        <!-- 超过时间限制是否回收 -->
        <property name="removeAbandoned" value="${jdbc.removeAbandoned}"/>

        <!-- 1800 秒,也就是 30 分钟 -->
        <property name="removeAbandonedTimeout" value="${jdbc.removeAbandonedTimeout}"/>

        <!-- 关闭 abanded 连接时输出错误日志 -->
        <property name="logAbandoned" value="${jdbc.logAbandoned}"/>
    </bean>

    <!-- 配置SqlSessionFactory对象 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 注入数据库连接池 -->
        <property name="dataSource" ref="dataSource"/>
        <!-- 扫描model包 使用别名 -->
        <property name="typeAliasesPackage" value="com.yoFish.model"/>
        <!-- 扫描sql配置文件:mapper需要的xml文件 -->
        <property name="mapperLocations" value="classpath:mapper/*.xml"/>
    </bean>

    <!-- 配置扫描Dao接口包,动态实现Dao接口,注入到spring容器中 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 注入sqlSessionFactory -->
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
        <!-- 给出需要扫描Dao接口包 -->
        <property name="basePackage" value="com.yoFish.dao"/>
    </bean>

    <!-- 配置事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!-- 注入数据库连接池 -->
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <!-- 配置基于注解的声明式事务 -->
    <tx:annotation-driven transaction-manager="transactionManager"/>

</beans>

这个问题搞了很久了,主要就是不知道问题在哪,本地真的是没有任何问题,很多方式我也试过了.很头疼,求大佬帮忙解决

2个回答

问题定性:Tomcat连接MySQL数据库出错。
问题分析:
1.本地数据库和本地测试无问题:说明mysql数据库能够正常连接,且防火墙等都无问题,对于ip应该也没有屏蔽,密码配置无问题。(同时再确定下上述无问题);
2.Tomcat不可达:(企业项目中我遇到过这种情况,当时是内网,不要设置路由,设置网关即可)使用telnet测试相关端口,如果不通,就是两个服务器互通的事情。

m0_38114057
m0_38114057 首先谢谢大佬给的思路,问题我解决了,druid换了最新版本并且jdbc换成了127.0.0.1之后到服务器正常使用.
2 个月之前 回复

看一下服务器上mysql的用户主机限制 数据库连接url和用户的主机要匹配图片说明

m0_38114057
m0_38114057 谢谢大佬,问题已经解决了!
2 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
.net 4.0 项目 连接mysql8.0.15 使用MySql.Data.dll 连接的时候报错
string connectStr = "Server=localhost;port=3306;Database=xxx;User ID=root;Password=xxx;"; MySqlConnection conn = new MySqlConnection(connectStr);//仍还没有建立连接 try { conn.Open();//建立连接 //string sql = "select * from users";//sql语句 //MySqlCommand cmd = new MySqlCommand(sql, conn);//建立命令 } catch(MySqlException ex) { } 异常信息: Authentication to host 'localhost' for user 'root' using method 'caching_sha2_password' failed with message: Access denied for user 'root'@'localhost' (using password: YES) 请问一下,mysql8.0.15不支持net4.0吗 我尝试修改验证方式: alter user ‘root’@'localhost' identified with mysql_native_password by '密码'; 但是也没用 详细异常信息 在 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.AuthenticationFailed(Exception ex) 在 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ReadPacket() 在 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.ContinueAuthentication(Byte[] data) 在 MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset) 在 MySql.Data.MySqlClient.NativeDriver.Open() 在 MySql.Data.MySqlClient.Driver.Open() 在 MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) 在 MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() 在 MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() 在 MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() 在 MySql.Data.MySqlClient.MySqlPool.GetConnection() 在 MySql.Data.MySqlClient.MySqlConnection.Open() 在 ConsoleAppMySql.Program.Connection() 位置 G:\数据库例子\ConsoleAppMySql\ConsoleAppMySql\Program.cs:行号 29
mysql5.7在centos下编写c语言程序操作数据库时,头文件#include<mysql/mysql.h>报错
mysql5.7在centos下编写c语言程序操作数据库时,头文件#include<mysql/mysql.h>报错![图片](https://img-ask.csdn.net/upload/201604/17/1460876984_149948.png)
怎样用python3.4连接mysql5.7里创建的数据库
求助,怎样用python3.4连接mysql5.7里创建的数据库
在win10子系统ubuntu18.04下安装mysql5.7尝试重新启动的时候出现以下报错
在win10子系统ubuntu18.04下安装mysql5.7尝试重新启动的时候出现以下报错 1.安装mysql-server ``` root@PC-5200:/home/tom# apt-get -y install mysql-server ``` ``` Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libfreetype6 Use 'apt autoremove' to remove it. The following additional packages will be installed: libaio1 libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-6 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libssl1.1 libtimedate-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 Suggested packages: libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx tinyca The following NEW packages will be installed: libaio1 libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-6 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7 The following packages will be upgraded: libssl1.1 1 upgraded, 21 newly installed, 0 to remove and 136 not upgraded. Need to get 21.0 MB of archives. After this operation, 157 MB of additional disk space will be used. Get:1 http://mirrors.aliyun.com/ubuntu bionic/main amd64 mysql-common all 5.8+1.0.4 [7308 B] Get:2 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 libaio1 amd64 0.3.110-5ubuntu0.1 [6476 B] Get:3 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 libssl1.1 amd64 1.1.1-1ubuntu2.1~18.04.5 [1300 kB] Get:4 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 mysql-client-core-5.7 amd64 5.7.28-0ubuntu0.18.04.4 [6644 kB] Get:5 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 mysql-client-5.7 amd64 5.7.28-0ubuntu0.18.04.4 [1943 kB] Get:6 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 mysql-server-core-5.7 amd64 5.7.28-0ubuntu0.18.04.4 [7432 kB] Get:7 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libevent-core-2.1-6 amd64 2.1.8-stable-4build1 [85.9 kB] Get:8 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 mysql-server-5.7 amd64 5.7.28-0ubuntu0.18.04.4 [2932 kB] Get:9 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libhtml-tagset-perl all 3.20-3 [12.1 kB] Get:10 http://mirrors.aliyun.com/ubuntu bionic/main amd64 liburi-perl all 1.73-1 [77.2 kB] Get:11 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libhtml-parser-perl amd64 3.72-3build1 [85.9 kB] Get:12 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libcgi-pm-perl all 4.38-1 [185 kB] Get:13 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libfcgi-perl amd64 0.78-2build1 [32.8 kB] Get:14 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libcgi-fast-perl all 1:2.13-1 [9940 B] Get:15 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libencode-locale-perl all 1.05-1 [12.3 kB] Get:16 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libhtml-template-perl all 2.97-1 [59.0 kB] Get:17 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libtimedate-perl all 2.3000-2 [37.5 kB] Get:18 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libhttp-date-perl all 6.02-1 [10.4 kB] Get:19 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libio-html-perl all 1.001-1 [14.9 kB] Get:20 http://mirrors.aliyun.com/ubuntu bionic/main amd64 liblwp-mediatypes-perl all 6.02-1 [21.7 kB] Get:21 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libhttp-message-perl all 6.14-1 [72.1 kB] Get:22 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 mysql-server all 5.7.28-0ubuntu0.18.04.4 [9940 B] Fetched 21.0 MB in 9s (2376 kB/s) Preconfiguring packages ... Selecting previously unselected package mysql-common. (Reading database ... 28663 files and directories currently installed.) Preparing to unpack .../0-mysql-common_5.8+1.0.4_all.deb ... Unpacking mysql-common (5.8+1.0.4) ... Selecting previously unselected package libaio1:amd64. Preparing to unpack .../1-libaio1_0.3.110-5ubuntu0.1_amd64.deb ... Unpacking libaio1:amd64 (0.3.110-5ubuntu0.1) ... Preparing to unpack .../2-libssl1.1_1.1.1-1ubuntu2.1~18.04.5_amd64.deb ... Unpacking libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.5) over (1.1.0g-2ubuntu4.3) ... Selecting previously unselected package mysql-client-core-5.7. Preparing to unpack .../3-mysql-client-core-5.7_5.7.28-0ubuntu0.18.04.4_amd64.deb ... Unpacking mysql-client-core-5.7 (5.7.28-0ubuntu0.18.04.4) ... Selecting previously unselected package mysql-client-5.7. Preparing to unpack .../4-mysql-client-5.7_5.7.28-0ubuntu0.18.04.4_amd64.deb ... Unpacking mysql-client-5.7 (5.7.28-0ubuntu0.18.04.4) ... Selecting previously unselected package mysql-server-core-5.7. Preparing to unpack .../5-mysql-server-core-5.7_5.7.28-0ubuntu0.18.04.4_amd64.deb ... Unpacking mysql-server-core-5.7 (5.7.28-0ubuntu0.18.04.4) ... Selecting previously unselected package libevent-core-2.1-6:amd64. Preparing to unpack .../6-libevent-core-2.1-6_2.1.8-stable-4build1_amd64.deb ... Unpacking libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Setting up mysql-common (5.8+1.0.4) ... update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode Selecting previously unselected package mysql-server-5.7. (Reading database ... 28832 files and directories currently installed.) Preparing to unpack .../00-mysql-server-5.7_5.7.28-0ubuntu0.18.04.4_amd64.deb ... Unpacking mysql-server-5.7 (5.7.28-0ubuntu0.18.04.4) ... Selecting previously unselected package libhtml-tagset-perl. Preparing to unpack .../01-libhtml-tagset-perl_3.20-3_all.deb ... Unpacking libhtml-tagset-perl (3.20-3) ... Selecting previously unselected package liburi-perl. Preparing to unpack .../02-liburi-perl_1.73-1_all.deb ... Unpacking liburi-perl (1.73-1) ... Selecting previously unselected package libhtml-parser-perl. Preparing to unpack .../03-libhtml-parser-perl_3.72-3build1_amd64.deb ... Unpacking libhtml-parser-perl (3.72-3build1) ... Selecting previously unselected package libcgi-pm-perl. Preparing to unpack .../04-libcgi-pm-perl_4.38-1_all.deb ... Unpacking libcgi-pm-perl (4.38-1) ... Selecting previously unselected package libfcgi-perl. Preparing to unpack .../05-libfcgi-perl_0.78-2build1_amd64.deb ... Unpacking libfcgi-perl (0.78-2build1) ... Selecting previously unselected package libcgi-fast-perl. Preparing to unpack .../06-libcgi-fast-perl_1%3a2.13-1_all.deb ... Unpacking libcgi-fast-perl (1:2.13-1) ... Selecting previously unselected package libencode-locale-perl. Preparing to unpack .../07-libencode-locale-perl_1.05-1_all.deb ... Unpacking libencode-locale-perl (1.05-1) ... Selecting previously unselected package libhtml-template-perl. Preparing to unpack .../08-libhtml-template-perl_2.97-1_all.deb ... Unpacking libhtml-template-perl (2.97-1) ... Selecting previously unselected package libtimedate-perl. Preparing to unpack .../09-libtimedate-perl_2.3000-2_all.deb ... Unpacking libtimedate-perl (2.3000-2) ... Selecting previously unselected package libhttp-date-perl. Preparing to unpack .../10-libhttp-date-perl_6.02-1_all.deb ... Unpacking libhttp-date-perl (6.02-1) ... Selecting previously unselected package libio-html-perl. Preparing to unpack .../11-libio-html-perl_1.001-1_all.deb ... Unpacking libio-html-perl (1.001-1) ... Selecting previously unselected package liblwp-mediatypes-perl. Preparing to unpack .../12-liblwp-mediatypes-perl_6.02-1_all.deb ... Unpacking liblwp-mediatypes-perl (6.02-1) ... Selecting previously unselected package libhttp-message-perl. Preparing to unpack .../13-libhttp-message-perl_6.14-1_all.deb ... Unpacking libhttp-message-perl (6.14-1) ... Selecting previously unselected package mysql-server. Preparing to unpack .../14-mysql-server_5.7.28-0ubuntu0.18.04.4_all.deb ... Unpacking mysql-server (5.7.28-0ubuntu0.18.04.4) ... Setting up libhtml-tagset-perl (3.20-3) ... Setting up libevent-core-2.1-6:amd64 (2.1.8-stable-4build1) ... Processing triggers for ureadahead (0.100.0-21) ... Setting up libencode-locale-perl (1.05-1) ... Setting up libtimedate-perl (2.3000-2) ... Setting up libio-html-perl (1.001-1) ... Setting up liblwp-mediatypes-perl (6.02-1) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... Setting up libaio1:amd64 (0.3.110-5ubuntu0.1) ... Setting up liburi-perl (1.73-1) ... Setting up libssl1.1:amd64 (1.1.1-1ubuntu2.1~18.04.5) ... Checking for services that may need to be restarted...done. Checking for services that may need to be restarted...done. Checking init scripts... Restarting services possibly affected by the upgrade: invoke-rc.d: could not determine current runlevel Services restarted successfully. Processing triggers for systemd (237-3ubuntu10.21) ... Setting up libhtml-parser-perl (3.72-3build1) ... Setting up libcgi-pm-perl (4.38-1) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Setting up mysql-client-core-5.7 (5.7.28-0ubuntu0.18.04.4) ... Setting up libfcgi-perl (0.78-2build1) ... Setting up libhttp-date-perl (6.02-1) ... Setting up libhtml-template-perl (2.97-1) ... Setting up mysql-server-core-5.7 (5.7.28-0ubuntu0.18.04.4) ... Setting up libcgi-fast-perl (1:2.13-1) ... Setting up libhttp-message-perl (6.14-1) ... Setting up mysql-client-5.7 (5.7.28-0ubuntu0.18.04.4) ... Setting up mysql-server-5.7 (5.7.28-0ubuntu0.18.04.4) ... invoke-rc.d: could not determine current runlevel * Stopping MySQL database server mysqld [ OK ] update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode Renaming removed key_buffer and myisam-recover options (if present) Cannot open /proc/net/unix: No such file or directory Cannot stat file /proc/1/fd/5: Operation not permitted Cannot stat file /proc/1/fd/10: Operation not permitted Cannot stat file /proc/1/fd/6: Operation not permitted Cannot stat file /proc/7/fd/7: Operation not permitted Cannot stat file /proc/7/fd/10: Operation not permitted Cannot stat file /proc/7/fd/5: Operation not permitted Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service. invoke-rc.d: could not determine current runlevel Setting up mysql-server (5.7.28-0ubuntu0.18.04.4) ... Processing triggers for libc-bin (2.27-3ubuntu1) ... Processing triggers for ureadahead (0.100.0-21) ... Processing triggers for systemd (237-3ubuntu10.21) ... ``` 2.启动mysql服务 ``` root@PC-5200:/home/tom# systemctl start mysql.service ``` 3.出现如下报错 ``` System has not been booted with systemd as init system (PID 1). Can't operate. ```
SSH项目中,连接mysql5.7数据库,权限不够
报错异常: ERROR [http-nio-8080-exec-1] - Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) 1.jdbc.properties中: ``` proxool.maxConnCount=5 proxool.minConnCount=2 proxool.statistics=1m,15m,1h,1d proxool.simultaneousBuildThrottle=5 proxool.trace=false proxool.verbose=false jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/ssh_employee jdbc.username=root jdbc.password=root ``` 2.datasource中: ``` <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="${jdbc.url}"></property> <property name="username" value="${jdbc.username}"></property> <property name="password" value="${jdbc.password}"></property> <property name="driverClassName" value="${jdbc.driverClassName}"></property> <property name="maxActive"> <value>100</value></property> <property name="maxIdle"> <value>30</value> </property> <property name="maxWait"> <value>10000</value> </property> </bean> ``` 3.数据库中用户和密码都是root,没有问题。 4.对root用户也都授予了权限,但是仍旧是这个问题。 控制台中是这样的报错: ![图片说明](https://img-ask.csdn.net/upload/201804/05/1522924428_40455.png) 页面报错是这样的: ![图片说明](https://img-ask.csdn.net/upload/201804/05/1522937422_80656.png) 4.另外 mysql5.7中的 my-default.init文件里面并没有密码之类的设置 ![图片说明](https://img-ask.csdn.net/upload/201804/06/1522993471_855733.jpg)
mysql 5.6 版本的程序跑mysql 8.0 报错如下 ,数据库可以正常连接,连接数据库的驱动等相关jar 也换成了mysql8.0对应版本还是报如下错误
[http-nio-8085-exec-3] INFO com.gdk.jdbc.connection.ConnectionPoolManager - ***** Add ConnectionPoolShutdownHook to JVM hook ***** [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging. [http-nio-8085-exec-3] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5 [built 02-January-2015 13:25:04 -0500; debug? true; trace: 10] [http-nio-8085-exec-3] WARN com.mchange.v2.c3p0.cfg.C3P0Config - named-config with name 'mysql' does not exist. Using default-config. [http-nio-8085-exec-3] WARN com.mchange.v2.c3p0.cfg.C3P0Config - named-config with name 'mysql' does not exist. Using default-config extensions. [http-nio-8085-exec-3] INFO com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider - >>>>>> C3P0ConnectionProvider startup initing with configuration: {"file":"/E:/tomcat/webapps/huajiu/WEB-INF/classes/datasource.xml","id":"mysql.1509899288","name":"mysql","driverClass":"com.mysql.cj.jdbc.Driver","driverUrl":"jdbc:mysql://47.XXX.XXX.229:3306/huajiu?useSSL=true","user":"root","password":"******","connectionProvider":"com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider","dialect":"com.gdk.jdbc.dialect.MySQLDialect","maxConnectionSize":10,"minConnectionSize":1,"initConnectionSize":1,"availableConnectionSize":1,"acquireIncrementSize":1,"maxConnectionIdletime":3600,"maxConnectionLifetime":14400,"acquireRetryAttempts":30,"acquireRetryDelay":2000,"idleConnectionTestPeriod":3600,"testConnectionCheckout":false,"testConnectionCheckin":false,"connectionTimeout":5000,"showSQL":false,"loadOnStartup":true,"monitorEnable":false,"weight":1,"_xaDataSourceClass":"com.mysql.jdbc.jdbc2.optional.MysqlXADataSource","customize":{}} [http-nio-8085-exec-3] INFO com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 2000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> mysql.1509899288, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgf2m9a61o8yo2f6gh111|79cc61a8, idleConnectionTestPeriod -> 3600, initialPoolSize -> 1, jdbcUrl -> jdbc:mysql://47.XXX.XXX.229:3306/huajiu?useSSL=true, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 14400, maxIdleTime -> 3600, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 1, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ] com.gdk.jdbc.connection.ConnectFailedException: Can not get a Master Connection from datasource<mysql>! at com.gdk.jdbc.connection.ConnectionPoolManager.getMasterConnection(ConnectionPoolManager.java:188) at com.gdk.jdbc.JdbcHandlerImpl.getMasterConnection(JdbcHandlerImpl.java:1780) at com.gdk.jdbc.JdbcHandlerImpl.getConnection(JdbcHandlerImpl.java:1767) at com.gdk.jdbc.JdbcHandlerImpl.queryForList(JdbcHandlerImpl.java:1156) at com.gdk.jdbc.JdbcHandlerImpl.queryForList(JdbcHandlerImpl.java:1138) at com.qshl.aqb.sys.dao.PlatformDao.getUserByUname(PlatformDao.java:21) at com.qshl.aqb.sys.service.impl.PlatformServiceImpl.login(PlatformServiceImpl.java:26) at com.qshl.aqb.sys.controller.PlatformController.unameLogin(PlatformController.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1156) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@1c2032db -- timeout at awaitAvailable() at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1461) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:639) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:549) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at com.gdk.jdbc.connection.c3p0.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:230) at com.gdk.jdbc.connection.ConnectionPoolManager.getMasterConnection(ConnectionPoolManager.java:177) ... 49 more
下载好mysql数据库版本8.0.1.7连接navicat报错
navicat连接报错1251 mysql数据库版本8.0.1.7 ![图片说明](https://img-ask.csdn.net/upload/201909/26/1569489392_799801.jpg)![图片说明](https://img-ask.csdn.net/upload/201909/26/1569489417_871275.jpg)![图片说明](https://img-ask.csdn.net/upload/201909/26/1569489765_960457.png)
为什么同样的存储过程,在mysql8.18中正常,在mysql5.7中错误
我有一个存储过程,在mysql8.18中运行正常,但是复制到mysql5.7中错误。错误码:1064。 在mysql8中的截图:![图片说明](https://img-ask.csdn.net/upload/201911/26/1574751799_768310.png) 在mysql5.7中的截图:![图片说明](https://img-ask.csdn.net/upload/201911/27/1574818613_733106.png)
MySQL5.7数据库中为什么只有4个数据库?
昨天手贱,不知道怎么搞得,把MySQL5.7搞得不工作了,一气之下便卸载了重装。。重装过后发现数据库有点不一样,,,原先是有information_schema, mysql, performance_schema, sakila, test, world, 共六个数据库,结果现在变得只剩下四个数据库,而且还有一个不一样(多了个sys)。我想请问只是怎么一回事啊?附上图:![图片说明](https://img-ask.csdn.net/upload/201601/31/1454209660_619371.png)
MyEclipse8.5 连接MYSQL5.5数据库的问题
<p>您好!我用MyEclipse8.5 + MySQL5.5 + win7环境下编写程序测试连接数据库的程序。但是出现以下问题:<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testQuery(jdbcTest1.java:29)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:148)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testInsert(jdbcTest1.java:62)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:149)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testQuery(jdbcTest1.java:29)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:150)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testUpdate(jdbcTest1.java:98)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:151)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testQuery(jdbcTest1.java:29)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:152)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testDelete(jdbcTest1.java:123)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:153)<br>java.lang.ClassNotFoundException: com.MySQL.jdbc.Driver<br> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br> at java.security.AccessController.doPrivileged(Native Method)<br> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br> at java.lang.Class.forName0(Native Method)<br> at java.lang.Class.forName(Class.java:169)<br> at MySQL.jdbcTest1.initJdbc(jdbcTest1.java:10)<br> at MySQL.jdbcTest1.getConnection(jdbcTest1.java:17)<br> at MySQL.jdbcTest1.testQuery(jdbcTest1.java:29)<br> at MySQL.jdbcTest1.main(jdbcTest1.java:154)<br>用mysql-connector-java-5.1.20-bin的jar驱动</p> <p>程序代码如下:package MySQL;</p> <p><br>import java.sql.*;<br>public class jdbcTest1 {</p> <p> boolean bInited=false;<br> //加载驱动<br> public void initJdbc() throws ClassNotFoundException{<br> Class.forName("com.MySQL.jdbc.Driver");<br> bInited=true;<br> }<br> //获得数据库连接<br> public Connection getConnection() throws ClassNotFoundException,<br> SQLException{<br> if(!bInited)<br> initJdbc();<br> return DriverManager<br> .getConnection("jdbc:MySQL://localhost:3306/mytest?user=root&amp;password" +<br> "=mjf10086&amp;useUnicode=true&amp;charaterEncoding=gb2312");<br> //注意,这里的字符集与数据库的设置一致<br> }<br><br> public void testQuery(){<br> Connection conn=null;<br> Statement smt = null;<br> ResultSet rs=null;<br> try{<br> conn = getConnection();<br> smt = conn.createStatement();<br> String sql = "select*from table1";<br> rs = smt.executeQuery(sql);<br> while(rs.next()){<br> System.out.println("id:"+rs.getInt("_id")+"username:"<br> +rs.getString("_username")+"password:"<br> +rs.getString("_password")+"desc:"<br> +rs.getString("_desc"));<br> }<br> }catch(SQLException e){<br> e.printStackTrace();<br> }catch(Exception e){<br> e.printStackTrace();<br> }finally{<br> try{<br> if(rs!=null)<br> rs.close();<br> if(smt!=null)<br> smt.close();<br> if(conn!=null)<br> conn.close();<br><br> }catch(Exception e){<br> e.printStackTrace();<br> }<br> }<br> }<br><br> public void testInsert(){<br> Connection conn = null;<br> Statement smt = null;<br> try{<br> conn = getConnection();<br> smt = conn.createStatement();<br> smt<br> .execute("insert into table1(_username,_password,_desc)values" +<br> "('马拉多纳','10','阿根廷足球运动员')");<br> smt<br> .execute("insert into table1(_username,_password,_desc)values" +<br> "('坎通纳','7','法国足球运动员')");<br> smt<br> .execute("insert into table1(_username,__password,_desc)values" +<br> "('罗马里奥','11','巴西足球运动员')");<br> smt<br> .execute("insert into table1(_username,_password,_desc)values" +<br> "('古利特','8','荷兰足球运动员')");<br><br> }catch(SQLException e){<br> e.printStackTrace();<br> }catch(Exception e){<br> e.printStackTrace();<br> }finally{<br> try{<br> if(smt !=null)<br> smt.close();<br> if(conn !=null)<br> conn.close();<br><br> }catch(Exception e){<br> e.printStackTrace();<br> }<br> }<br> }<br><br> public void testUpdate(){<br> Connection conn = null;<br> Statement smt = null;<br> try{<br> conn = getConnection();<br> smt = conn.createStatement();<br> smt<br> .execute("update table1 set _desc '阿根廷足球球员,一代球王'" +<br> "where _username='马拉多纳'");<br> }catch(SQLException e){<br> e.printStackTrace();<br> }catch(Exception e){<br> e.printStackTrace();<br> }finally{<br> try{<br> if(smt!=null)<br> smt.close();<br> if(conn!=null)<br> conn.close();<br> }catch(Exception e){<br> e.printStackTrace();<br> }<br> }<br> }<br><br> public void testDelete(){<br> Connection conn = null;<br> Statement smt = null;<br> try{<br> conn = getConnection();<br> smt = conn.createStatement();<br> smt.execute("delete from table1 where _username = '马拉多纳'");<br> smt.execute("delete from table1 where _username = '坎通纳'");<br> smt.execute("delete from table1 where _username = '罗马里奥'");<br> smt.execute("delete from table1 where _username = '古利特'");</p> <p> }catch(SQLException e){<br> e.printStackTrace();<br> }catch(Exception e){<br> e.printStackTrace();<br> }finally{<br> try{<br> if(smt !=null)<br> smt.close();<br> if(conn !=null)<br> conn.close();<br> }catch(Exception e){<br> e.printStackTrace();<br> }<br> }<br> }<br><br> public static void main(String[] args){<br> jdbcTest1 jt1 = new jdbcTest1();<br> jt1.testQuery();<br> jt1.testInsert();<br> jt1.testQuery();<br> jt1.testUpdate();<br> jt1.testQuery();<br> jt1.testDelete();<br> jt1.testQuery();<br> }<br>}</p>
linux下安装Mysql5.7出现的问题,搞了一天了!
出现了如下问题: --> Finished Dependency Resolution Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libsasl2.so.3()(64bit) Error: Package: mysql-community-client-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) Error: Package: mysql-community-libs-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libc.so.6(GLIBC_2.14)(64bit) Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community) Requires: systemd Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) Error: Package: mysql-community-client-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libc.so.6(GLIBC_2.14)(64bit) Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community) Requires: libc.so.6(GLIBC_2.17)(64bit) 试着装了一次mysql5.6没有问题,但是装5.7却出现了这个问题,求助!!
mysql.sock.lock文件被删除了,数据库访问不了
本来直接在终端是可以连接数据库的,但是navicat连接不了,然后百度了些方法,然后在试的时候一不小心把MAMP/tmp/mysql.cosk和mysql.sock.lock这个文件给删除了,然后现在输入mysql -u root -p,后,还是会跳出输入密码,但是输入密码后报错,ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock'这是报错信息,求大佬执教!!!万分感谢!
mysql5.7.17声明光标报错
mysql版本:5.7.17 语句:DECLARE cursor_fruit CURSOR FOR SELECT f_name, f_price FROM fruits; 报错见截图,请教下大神怎么解决! [图片说明](https://img-ask.csdn.net/upload/201705/15/1494852430_38894.png)
Linux编译mysql8.0.15报错,求大神
/usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在函数‘Json_dom_ptr merge_doms(Json_dom_ptr, Json_dom_ptr)’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:112:12: 错误:无法将左值‘Json_object_ptr {aka std::unique_ptr<Json_object>}’绑定到‘std::unique_ptr<Json_object>&&’ return left_object; ^ In file included from /usr/local/include/c++/4.8.4/memory:81:0, from /usr/local/src/mysql-8.0.15/sql/json_dom.h:29, from /usr/local/src/mysql-8.0.15/sql/json_dom.cc:23: /usr/local/include/c++/4.8.4/bits/unique_ptr.h:169:2: 错误:以初始化‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_object; _Ep = std::default_delete<Json_object>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]的实参 1 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc:125:10: 错误:无法将左值‘Json_array_ptr {aka std::unique_ptr<Json_array>}’绑定到‘std::unique_ptr<Json_array>&&’ return left_array; ^ In file included from /usr/local/include/c++/4.8.4/memory:81:0, from /usr/local/src/mysql-8.0.15/sql/json_dom.h:29, from /usr/local/src/mysql-8.0.15/sql/json_dom.cc:23: /usr/local/include/c++/4.8.4/bits/unique_ptr.h:169:2: 错误:以初始化‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_array; _Ep = std::default_delete<Json_array>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’实参 1 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在成员函数‘virtual Json_dom_ptr Json_object::clone() const’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:1010:10: 错误:无法将左值‘Json_object_ptr {aka std::unique_ptr<Json_object>}’绑定到‘std::unique_ptr<Json_object>&&’ return o; ^ In file included from /usr/local/include/c++/4.8.4/memory:81:0, from /usr/local/src/mysql-8.0.15/sql/json_dom.h:29, from /usr/local/src/mysql-8.0.15/sql/json_dom.cc:23: /usr/local/include/c++/4.8.4/bits/unique_ptr.h:169:2: 错误:以初始化‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_object; _Ep = std::default_delete<Json_object>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]的实参 1 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在成员函数‘virtual Json_dom_ptr Json_array::clone() const’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:1150:10: 错误:无法将左值‘Json_array_ptr {aka std::unique_ptr<Json_array>}’绑定到‘std::unique_ptr<Json_array>&&’ return vv; ^ In file included from /usr/local/include/c++/4.8.4/memory:81:0, from /usr/local/src/mysql-8.0.15/sql/json_dom.h:29, from /usr/local/src/mysql-8.0.15/sql/json_dom.cc:23: /usr/local/include/c++/4.8.4/bits/unique_ptr.h:169:2: 错误:以初始化‘std::unique_ptr<_Tp, _Dp>::unique_ptr(std::unique_ptr<_Up, _Ep>&&) [with _Up = Json_array; _Ep = std::default_delete<Json_array>; <template-parameter-2-3> = void; _Tp = Json_dom; _Dp = std::default_delete<Json_dom>]’实参 1 unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在函数‘Json_dom_ptr merge_doms(Json_dom_ptr, Json_dom_ptr)’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:127:1: 警告:在有返回值的函数中,控制流程到达函数尾 [-Wreturn-type] } ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在成员函数‘virtual Json_dom_ptr Json_object::clone() const’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:1012:1: 警告:在有返回值的函数中,控制流程到达函数尾 [-Wreturn-type] } ^ /usr/local/src/mysql-8.0.15/sql/json_dom.cc: 在成员函数‘virtual Json_dom_ptr Json_array::clone() const’中: /usr/local/src/mysql-8.0.15/sql/json_dom.cc:1152:1: 警告:在有返回值的函数中,控制流程到达函数尾 [-Wreturn-type] } ^ make[2]: *** [sql/CMakeFiles/sql_main.dir/json_dom.cc.o] 错误 1 make[1]: *** [sql/CMakeFiles/sql_main.dir/all] 错误 2 make: *** [all] 错误 2
centos6安装mysql5.7出错:yum install mysql-community-server出错
安装mysql5.7,参考教程:https://www.php.cn/mysql-tutorials-386847.html 一开始不知道 地址中的el7应该对应自己的centos版本,直接执行该命令进行下载 ``` wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm ``` 然后执行以下命令也没有报错, ``` yum -y localinstall mysql57-community-release-el7-11.noarch.rpm ``` 但是执行下面命令的时候一直报错 ``` yum -y install mysql-community-server ``` 之后重新下载centos6的版本,安装源 ``` # wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm # yum -y localinstall mysql57-community-release-el6-11.noarch.rpm ``` 然而进行安装的时候还是报错 ``` yum -y install mysql-community-server ``` 原因在于他还是跑去安装el7的版本了 ``` ---> Package mysql-community-server.i686 0:5.7.17-1.el7 will be 安装 ``` 尝试了各种方法,重装了好多次,能删除的就删除,结果一直都是这样 获取mysql-community-server的信息,结果如下: ![图片说明](https://img-ask.csdn.net/upload/201907/25/1563987255_628071.png) 尝试删除无果: ``` [root@localhost ~]# yum remove mysql-community-server 已加载插件:fastestmirror, security 设置移除进程 参数 mysql-community-server 没有匹配 Loading mirror speeds from cached hostfile Package(s) mysql-community-server available, but not installed. 不删除任何软件包 ``` 真的搞了一天,心累啊!如果哪个好心人看到,可以提点提点,真的万分感谢!
linux下使用sqoop连接windows的MySQL数据库报错
刚入门学习hadoop,然后在sqoop数据迁移这里遇到了问题,linux下使用sqoop连接不上windows系统的MySQL数据库,按照网上的许多方法都没解决。 linux系统是centos6.4,然后hadoop2.4.1,sqoop1.4.7,windows下是mysql5.7 下面是报错信息: [root@itcast01 bin]# ./sqoop list-tables --connect jdbc:mysql://192.168.147.100:3306/sqoopex1 --username root -password 1234 18/07/12 16:17:28 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7 18/07/12 16:17:28 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 18/07/12 16:17:28 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset. 18/07/12 16:18:31 ERROR manager.CatalogQueryManager: Failed to list tables com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,531,383,511,816 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2214) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:773) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:904) at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:59) at org.apache.sqoop.manager.CatalogQueryManager.listTables(CatalogQueryManager.java:102) at org.apache.sqoop.tool.ListTablesTool.run(ListTablesTool.java:49) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243) at org.apache.sqoop.Sqoop.main(Sqoop.java:252) Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 1,531,383,511,809 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2137) ... 21 more Caused by: java.net.ConnectException: 连接超时 at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:290) ... 22 more zookeeper和hadoop服务都开启了的,防火墙也关闭了,去度娘有人说修改my.ini文件,说在[mysqld] 那里加一行: wait_timeout=86400 。 但是我修改后还是报同样的错误。mysql权限也赋予了的。数据库连接驱动使用mysql-connector-5.1.8.jar。 ![图片说明](https://img-ask.csdn.net/upload/201807/12/1531385340_467365.png) ![图片说明](https://img-ask.csdn.net/upload/201807/12/1531384769_440982.png) 连接的ip地址192.168.147.100是windows的VMnet1的ip地址,能ping通。然后就是连接不上数据库。使用Navicat连接也能连得上。 ![图片说明](https://img-ask.csdn.net/upload/201807/12/1531384494_888105.png) ![图片说明](https://img-ask.csdn.net/upload/201807/12/1531384583_92826.png) 有没有大牛知道我问题出在哪里?感激不尽!
jmeter测试mysql数据库报 通信链路故障 (mysql是5.7的)
Response message: java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)![图片说明](https://img-ask.csdn.net/upload/201912/20/1576842161_100444.png)
关于centos7.0进入mysql5.7无法输入中文
我用的是云服务器,然后用bitwise SHH和putty远程登录 装了mysql5.7数据库,不能输入中文,只能输入字符,没进入数据库的话,就可以在控制台 输入中文。数据库编码我全设为utf8也没有用。敲中文就是敲不进去
求救:centos6.8中的mysql 5.7启动报错
centos6.8中的mysql 5.7启动出现basedir:command not found及datadir:command not found报错![图片说明](https://img-ask.csdn.net/upload/201901/27/1548561728_469847.png)
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
Spring Boot2 系列教程(十七)SpringBoot 整合 Swagger2
前后端分离后,维护接口文档基本上是必不可少的工作。 一个理想的状态是设计好后,接口文档发给前端和后端,大伙按照既定的规则各自开发,开发好了对接上了就可以上线了。当然这是一种非常理想的状态,实际开发中却很少遇到这样的情况,接口总是在不断的变化之中,有变化就要去维护,做过的小伙伴都知道这件事有多么头大!还好,有一些工具可以减轻我们的工作量,Swagger2 就是其中之一,至于其他类似功能但是却收费的软...
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
天天学JAVA-JAVA基础(6)
如果觉得我写的还行,请关注我的博客并且点个赞哟。本文主要介绍JAVA 中最常使用字符串常量String相关知识。 1.String简介 2.创建字符串对象两种方式的区别 3.String常用的方法 4.String的不可变性 5.一道阿里面试题,你会做吗? 1.String简介 1.1String源码 首先看一段String源码,String主要实现了Serializable、Compar...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
2020 网络课 智慧树自动刷课代码,自动跳转,自动答题并关闭弹窗,自动1.5倍速静音
刷课一时爽,一直刷课一直爽! 终于让我找到了这个黑客代码了,教程开始: 只限谷歌浏览器和火狐浏览器使用,如果第一次失败,请重新试一下次 将下面代码复制后,进入浏览器按F12键,先点击console 然后Ctrl+v复制代码 最后按回车键即可 var ti = $("body"); var video = $(".catalogue_ul1 li[id*=video-]"); var i = 1;...
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
致 Python 初学者
文章目录1. 前言2. 明确学习目标,不急于求成,不好高骛远3. 在开始学习 Python 之前,你需要做一些准备2.1 Python 的各种发行版2.2 安装 Python2.3 选择一款趁手的开发工具3. 习惯使用IDLE,这是学习python最好的方式4. 严格遵从编码规范5. 代码的运行、调试5. 模块管理5.1 同时安装了py2/py35.2 使用Anaconda,或者通过IDE来安装模
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
羞,Java 字符串拼接竟然有这么多姿势
二哥,我今年大二,看你分享的《阿里巴巴 Java 开发手册》上有一段内容说:“循环体内,拼接字符串最好使用 StringBuilder 的 append 方法,而不是 + 号操作符。”到底为什么啊,我平常一直就用的‘+’号操作符啊!二哥有空的时候能否写一篇文章分析一下呢? 就在昨天,一位叫小菜的读者微信我说了上面这段话。 我当时看到这条微信的第一感觉是:小菜你也太菜了吧,这都不知道为啥啊!我估...
写1行代码影响1000000000人,这是个什么项目?
不带钱不带卡,只带手机出门就能畅行无阻,这已是生活的常态。益普索发布的《2019第一季度第三方移动支付用户研究》报告显示,移动支付在手机网民中的渗透率高达95.1%,截至今年1月,支付宝全球用户数已经突破10亿。你或许每天都会打开支付宝,付款购物、领取权益、享受服务……但你或许不知道的是,在这个方便、快捷、智能化的APP背后,有一群年轻的技术人,用智慧和创新让它每天都变得更“聪明”一点。 ...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
一点一滴记录 Java 8 stream 的使用
日常用到,一点一滴记录,不断丰富,知识积累,塑造自身价值。欢迎收藏 String 转 List String str = 1,2,3,4; List&lt;Long&gt; lists = Arrays.stream(str.split(",")).map(s -&gt; Long.parseLong(s.trim())).collect(Collectors.toList()); Lis...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 如何提升c#开发能力 矩阵乘法c# c#调用谷歌浏览器 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天
立即提问