关于centos7.0进入mysql5.7无法输入中文

我用的是云服务器,然后用bitwise SHH和putty远程登录
装了mysql5.7数据库,不能输入中文,只能输入字符,没进入数据库的话,就可以在控制台
输入中文。数据库编码我全设为utf8也没有用。敲中文就是敲不进去

3个回答

以解决,编码问题,改系统编码为utf8

lzghxjt
鹤啸九天-西木 请问下你说的系统编码是指?locale命令查了所有的都是zh_CN.UTF-8。我也遇到和你同样的问题
5 个月之前 回复
k1210228840
和二不要调皮 根本不是乱码问题,而且编码我也都设为utf8了,输入法一换成中文就什么都输不进去了,光标动都不动
3 年多之前 回复

一、登录MySQL,使用SHOW VARIABLES LIKE 'character%';查看当前使用的字符集,显示如下:

character_set_database和character_set_server的默认字符集是latin1。
二、最简单的完美修改方法,修改mysql的my.cnf文件中的字符集键值(注意配置的字段细节):
1、在[client]字段里加入default-character-set=utf8,如下:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-character-set=utf8

2、在[mysqld]字段里加入下面红色三句,如下:
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci

3、在[mysql]字段里加入default-character-set=utf8,如下:
[mysql]
no-auto-rehash
default-character-set=utf8

修改完成后,service mysql restart重启mysql服务就生效。注意:在较新版的mysq中,[mysqld]字段与[mysql]字段是有区别的。

使用SHOW VARIABLES LIKE 'character%';查看,发现数据库编码全已改成utf8。

4、如果上面的都修改了还乱码,那剩下问题就一定在connection连接层上。解决方法是在发送查询前执行一下下面这句(直接写在SQL文件的最前面):
SET NAMES 'utf8';
5、使用show create database 数据库名; 查看指定数据库的编码方式,如下:

修改指定数据库的编码:
mysql>user mydb;
mysql>alter database mydb character set utf8;
使用show create table 表名; 查看表的编码格式。如下:

设置默认编码为utf8:
set names utf8;
设置数据库db_name默认为utf8:
ALTER DATABASE db_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
设置表tb_name默认编码为utf8:
ALTER TABLE tb_name DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

k1210228840
和二不要调皮 我不是说了吗我全设为utf8了,问题是不能输入中文,输入法一换成中文就什么都输不进去了,不是什么乱码之类的问题
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
CentOS6.9 (MySql v5.7.22) 使用mysql C API mysql_real_query 导致内存溢出
当我开始循环调用sql语法,比如 UPDATE ** SET ** , mysql_real_query API会导致系统内存持续不断的增长,直到测试进程崩溃或者系统崩溃。我使用top命令查看系统内存的分配情况,很奇怪的是mysqld 和我的测试程序 sqltest都没有看到内存的增加,而系统的free内存一直在减少,used内存一直在增加,最后导致系统崩溃。 代码我实在是检查过很多遍了看不出什么问题, 大神帮我看下。 ``` int ThreadExeSQL(MYSQL* lpSQLConn, char * sql, int iLen) { if (mysql_real_query(lpSQLConn, sql, iLen)) { MYSQL_RES* lpGetSQLRes = mysql_store_result(lpSQLConn); mysql_free_result(lpGetSQLRes); return -1; } //mysql_errno(lpSQLConn); //mysql_error(lpSQLConn); MYSQL_RES* lpGetSQLRes = mysql_store_result(lpSQLConn); mysql_free_result(lpGetSQLRes); // release sql memory return 0; // success } void* ThreadSQL_HexWrite(void* lpGet) { LPThreadParam getParam = (LPThreadParam)lpGet; MYSQL* lpSQLConn = (MYSQL*)&getParam->lpSQLConn; int iThreadIdx = getParam->iThreadIdx; printf("ID:%d\n", iThreadIdx); mysql_thread_init(); lpSQLConn = mysql_init(NULL); if (!mysql_real_connect(lpSQLConn, g_host_name, g_user_name, g_password, g_db_name, g_db_port, NULL, 0)) { ThreadSQLError(lpSQLConn, NULL); return; } else { printf("mysql_real_connect OK!\n"); } for (int i = 0; i < 1000000; i++) { char lpCmdStr[8192] = "\0"; sprintf(lpCmdStr, "update %s set %s=0x%d where id=%d\0", "tb_Data", "Info", i, 1); if (ThreadExeSQL(lpSQLConn, (char*)lpCmdStr, strlen(lpCmdStr))) { MySQLError getError = ThreadSQLError(lpSQLConn, NULL); HandleMySqlError(getError); return; //erroe } else { printf("ok. "); } usleep(1000 * 10); } mysql_close(lpSQLConn); mysql_thread_end(); printf("ThreadSQL_HexWrite OK!\n"); } MYSQL* g_MySQLConnList[100]; void main() { if (mysql_library_init(0, NULL, NULL)) { printf("could not initialize MySQL client library\n"); exit(1); } int thread_num = 1; //while (true) { pthread_t *pTh = new pthread_t[thread_num]; for (int i = 0; i < thread_num; i++) { LPThreadParam lpSetParam = new ThreadParam; lpSetParam->lpSQLConn = (MYSQL*)&g_MySQLConnList[i]; lpSetParam->iThreadIdx = i; printf("---create thread idx:%d\n", i); if (0 != pthread_create(&pTh[i], NULL, ThreadSQL_HexWrite, lpSetParam)) { printf("pthread_create failed\n"); continue; } } for (int i = 0; i < thread_num; i++) { pthread_join(pTh[i], NULL); } delete[] pTh; } mysql_library_end(); printf("All Done!\n"); } ```
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. 不删除任何软件包 ``` 真的搞了一天,心累啊!如果哪个好心人看到,可以提点提点,真的万分感谢!
centos6.5断电重启后,MySQL启动失败
MySQL启动的错误日志如下: 161213 16:07:39 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 2016-12-13 16:07:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-12-13 16:07:40 5243 [Note] Plugin 'FEDERATED' is disabled. 2016-12-13 16:07:40 5243 [Note] InnoDB: The InnoDB memory heap is disabled 2016-12-13 16:07:40 5243 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2016-12-13 16:07:40 5243 [Note] InnoDB: Compressed tables use zlib 1.2.3 2016-12-13 16:07:40 5243 [Note] InnoDB: Using Linux native AIO 2016-12-13 16:07:40 5243 [Note] InnoDB: Using CPU crc32 instructions 2016-12-13 16:07:40 5243 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2016-12-13 16:07:40 5243 [Note] InnoDB: Completed initialization of buffer pool 2016-12-13 16:07:40 5243 [Note] InnoDB: Highest supported file format is Barracuda. 2016-12-13 16:07:40 5243 [Note] InnoDB: Log scan progressed past the checkpoint lsn 6528157 2016-12-13 16:07:40 5243 [Note] InnoDB: Database was not shutdown normally! 2016-12-13 16:07:40 5243 [Note] InnoDB: Starting crash recovery. 2016-12-13 16:07:40 5243 [Note] InnoDB: Reading tablespace information from the .ibd files... 2016-12-13 16:07:40 5243 [Note] InnoDB: Restoring possible half-written data pages 2016-12-13 16:07:40 5243 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 6528267 2016-12-13 16:07:40 5243 [Note] InnoDB: 128 rollback segment(s) are active. 2016-12-13 16:07:40 5243 [Note] InnoDB: Waiting for purge to start 2016-12-13 16:07:40 7f161458c700 InnoDB: Assertion failure in thread 139732807370496 in file trx0purge.cc line 699 InnoDB: Failing assertion: purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_no InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 08:07:40 UTC - mysqld got signal 6 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=268435456 read_buffer_size=1048576 max_used_connections=0 max_threads=151 thread_count=0 connection_count=0 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 728082 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x0 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 0 thread_stack 0x40000 /usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x9024f5] /usr/local/mysql/bin/mysqld(handle_fatal_signal+0x3e8)[0x66f518] /lib64/libpthread.so.0[0x3030a0f710] /lib64/libc.so.6(gsignal+0x35)[0x3030632925] /lib64/libc.so.6(abort+0x175)[0x3030634105] /usr/local/mysql/bin/mysqld[0x9d8308] /usr/local/mysql/bin/mysqld[0x9d9936] /usr/local/mysql/bin/mysqld[0x9c82eb] /usr/local/mysql/bin/mysqld[0x9cc0b8] /lib64/libpthread.so.0[0x3030a079d1] /lib64/libc.so.6(clone+0x6d)[0x30306e8b6d] The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 161213 16:07:40 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysqld.pid ended
centos7安装mysql workbench 依赖检测失败
[root@localhost tmp]# rpm -ivh mysql-workbench-gpl-5.2.47-1el6.i686.rpm 错误:依赖检测失败: libGL.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libX11.so.6 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libatk-1.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libatkmm-1.6.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.1) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.1.3) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.2) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.3) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.3.4) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libc.so.6(GLIBC_2.4) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libcairo.so.2 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libcairomm-1.0.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libcrypt.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libcrypto.so.10 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libdl.so.2 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libdl.so.2(GLIBC_2.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libdl.so.2(GLIBC_2.1) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libfontconfig.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libfreetype.so.6 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgcc_s.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgcc_s.so.1(GCC_3.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgcc_s.so.1(GLIBC_2.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgdk-x11-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgdk_pixbuf-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgdkmm-2.4.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgio-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgiomm-2.4.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libglib-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libglibmm-2.4.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgmodule-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgnome-keyring.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgobject-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgthread-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgtk-x11-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libgtkmm-2.4.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 liblua-5.1.so 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libm.so.6 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libm.so.6(GLIBC_2.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libm.so.6(GLIBC_2.1) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libmysqlclient_r.so.16 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libmysqlclient_r.so.16(libmysqlclient_16) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libnsl.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpango-1.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpangocairo-1.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpangoft2-1.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpangomm-1.4.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpcre.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpthread.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpthread.so.0(GLIBC_2.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libpython2.6.so.1.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 librt.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libsigc-2.0.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libsqlite3.so.0 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libssl.so.10 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(CXXABI_1.3) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(CXXABI_1.3.1) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(GLIBCXX_3.4) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(GLIBCXX_3.4.10) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(GLIBCXX_3.4.11) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libstdc++.so.6(GLIBCXX_3.4.9) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libuuid.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libuuid.so.1(UUID_1.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libxml2.so.2 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libxml2.so.2(LIBXML2_2.4.30) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libxml2.so.2(LIBXML2_2.6.0) 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libz.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 libzip.so.1 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 pexpect 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 python-paramiko 被 mysql-workbench-gpl-5.2.47-1el6.i686 需要 请问这个怎麼解决阿。
虚拟机centos7上装MySQL5.7.18出现的问题
运行:systemctl start mysqld 错误:Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. mysqld.log中的提示: 2017-04-19T15:20:26.718566Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation. 2017-04-19T15:20:26.718643Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory. 2017-04-19T15:20:26.718655Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions 2017-04-19T15:20:26.718728Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2017-04-19T15:20:28.189585Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2017-04-19T15:20:28.189678Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2017-04-19T15:20:28.189696Z 0 [ERROR] Failed to initialize plugins. 2017-04-19T15:20:28.189708Z 0 [ERROR] Aborting 2017-04-19T15:20:28.189763Z 0 [Note] Binlog end 2017-04-19T15:20:28.192297Z 0 [Note] Shutting down plugin 'CSV' 2017-04-19T15:20:28.194679Z 0 [Note] /usr/sbin/mysqld: Shutdown complete 2017-04-19T15:20:31.320424Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-04-19T15:20:31.323827Z 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory. 2017-04-19T15:20:31.323949Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18) starting as process 69981 ...
CentOS7 中启动sonarqube7.3,启动后自己会关闭,mysql是5.7版本,jdk是openjdk1.8版本。这个是什么情况
--> Wrapper Started as Daemon Launching a JVM... Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. 2018.10.26 11:15:47 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /usr/local/sonar/sonarqube-7.3/temp 2018.10.26 11:15:47 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001 2018.10.26 11:15:47 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/usr/local/sonar/sonarqube-7.3/elasticsearch]: /usr/local/sonar/sonarqube-7.3/elasticsearch/bin/elasticsearch -Epath.conf=/usr/local/sonar/sonarqube-7.3/temp/conf/es 2018.10.26 11:15:47 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running 2018.10.26 11:15:47 INFO app[][o.e.p.PluginsService] no modules loaded 2018.10.26 11:15:47 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin] 2018.10.26 11:15:48 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1 2018.10.26 11:15:48 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped 2018.10.26 11:15:48 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped <-- Wrapper Stopped
如何下载MySQL-devel-5.6.24-1.el6.x86_64 求连接地址
因为缺少mysql-config 不知道如何下载MySQL-devel-5.6.24-1.el6.x86_64 在linux安装hue报的错 * File "setup.py", line 15, in <module> * metadata, options = get_config() * File "/opt/module/hue-3.7.0-cdh5.3.6/desktop/core/ext-py/MySQL-python-1.2.3c1/setup_posix.py", line 43, in get_config * libs = mysql_config("libs_r") * File "/opt/module/hue-3.7.0-cdh5.3.6/desktop/core/ext-py/MySQL-python-1.2.3c1/setup_posix.py", line 24, in mysql_config * raise EnvironmentError("%s not found" % (mysql_config.path,)) * EnvironmentError: mysql_config not found * make[2]: *** [/opt/module/hue-3.7.0-cdh5.3.6/desktop/core/build/MySQL-python-1.2.3c1/egg.stamp] 错误 1 * make[2]: Leaving directory `/opt/module/hue-3.7.0-cdh5.3.6/desktop/core' * make[1]: *** [.recursive-env-install/core] 错误 2 * make[1]: Leaving directory `/opt/module/hue-3.7.0-cdh5.3.6/desktop' * make: *** [desktop] 错误 2 下面是我百度的方法 1. 通过报错信息看出是缺少mysql_config,在/usr/bin/下面应该有的mysql_config文件没有, * 网上的解决方案都是apt-get install libmysqlclient-dev,但是apt-get是Debian、Ubuntu系列的网络安装命令, * yum是Redhat、Centos、Fedora是网络安装命令,接着发现Centos上应该安装mysql-devel * 2. yum install mysql-devel,发现有冲突,报错如下: * 3. 使用 rpm -qa|grep mysql查看mysql的安装情况 * mysql-devel-5.6.24-1.el6_4.x86_64 * mysql-client-5.6.24-1.el6_4.x86_64 * mysql-server-5.6.24-1.el6_4.x86_64 * 4. 使用rpm -e mysql-devel-5.6.24-1.el6_4.x86_64移除已有的安装包 * 5. 再次使用yum install mysql-devel 发现和mysql-server, mysql-client的版本有冲突 * 6. 去网上寻找相同的版本下载http://downloads.skysql.com/archive/index/p/mysql/v/5.5.16,下载64bit的rpm文件,使用rpm -ivh MySQL-devel-5.5.16-1.linux2.6.x86_64.rpm安装 * 7. 安装成功后,去/usr/bin/目录下,发现生成了mysql_config文件,继续pip install mysql-python,顺利完成 提供下载地址 ![图片说明](https://img-ask.csdn.net/upload/201903/08/1552033978_619340.jpg)
MySql Clustor 管理节点连不上 sql节点
实在没辙了,倒腾了很久,看了很多帖子都没有解决。 PS:国内程序员的习惯太不好,很多不结贴,而且就算自己解决了,也不说解决方案。诶。。。 背景:管理节点和数据节点已经成功启动,sql节点也运行了,sql节点的log没有错误日志,而且本机数据库能正常登陆 管理节点:Linux CentOS 6.2 IP:192.168.10.226 数据节点:Linux CentOS 6.2 IP:192.168.10.52 SQL节点1:Linux CentOS 6.2 IP:192.168.10.41 SQL节点2:Linux CentOS 6.2 IP:192.168.10.42 每台服务器的防火墙均已关闭。 管理节点配置: ``` datadir = /usr/local/mysql/ndbdata [ndbd default] NoOfReplicas = 1 DataMemory = 80M IndexMemory = 18M datadir = /usr/local/mysql/ndbdata [ndb_mgmd] NodeId = 1 HostName = 192.168.10.226 [ndbd] NodeId = 2 HostName = 192.168.10.52 [mysqld] NodeId = 3 HostName = 192.168.10.41 [mysqld] NodeId = 4 HostName = 192.168.10.42 ``` 数据节点的配置文件 ``` [root@test-socket2 bin]# cat /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid ndbcluster ndb-connectstring = 192.168.10.226 [mysql_cluster] ndb-connectstring = 192.168.10.226 [root@test-socket2 bin]# cat /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid ndbcluster ndb-connectstring = 192.168.10.226 [mysql_cluster] ndb-connectstring = 192.168.10.226 [root@test-socket2 bin]# vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql ndbcluster ndb-connectstring = 192.168.10.226 [mysql_cluster] ndb-connectstring = 192.168.10.226 ``` SQL 节点的配置文件: ``` [root@test-web1 data]# cat /etc/my.cnf [mysqld] #datadir=/var/lib/mysql socket=/tmp/mysql.sock user=mysql port=3306 basedir=/usr/local/mysql/ datadir=/usr/local/mysql/ndbdata # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid ndbcluster ndb-connectstring = 192.168.10.226 [ndbd] connect-string=192.168.10.52 [ndbd_mgm] connect-string=192.168.10.226 [ndbd_mgmd] config-file=/etc/config.ini [mysql_cluster] ndb-connectstring = 192.168.10.226 ``` 管理节点链接状态: ``` ndb_mgm> show Connected to Management Server at: localhost:1186 Cluster Configuration --------------------- [ndbd(NDB)] 1 node(s) id=2 @192.168.10.52 (mysql-5.6.27 ndb-7.4.8, Nodegroup: 0, *) [ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.10.226 (mysql-5.6.27 ndb-7.4.8) [mysqld(API)] 2 node(s) id=3 (not connected, accepting connect from 192.168.10.41) id=4 (not connected, accepting connect from 192.168.10.42) ```
Mysql5.7.19交叉编译用于移植ARM时编译出现问题,求助
ometry/util/math.hpp:28, from /root/work/mysql-arm/sql/gis_bg_traits.h:38, from /root/work/mysql-arm/sql/item_geofunc_internal.h:35, from /root/work/mysql-arm/sql/geometry_rtree.cc:16: /usr/bin/locale:16:279: error: expected declaration before ‘}’ token make[2]: *** [sql/CMakeFiles/sql.dir/geometry_rtree.cc.o] Error 1 make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2 make: *** [all] Error 2 源码是mysql-boost-5.7.19.tar.gz 位将源码解压复制成两份,mysql-64/ 、 mysql-arm。一份用于CentOs64位上gcc编译,一份用于交叉编译。编译到45%左右死活过不去。求解 贴上错误log [ 45%] Building CXX object sql/CMakeFiles/sql.dir/geometry_rtree.cc.o In file included from /usr/bin/boost/lexical_cast/detail/converter_lexical_streams.hpp:43:0, from /usr/bin/boost/lexical_cast/detail/converter_lexical.hpp:54, from /usr/bin/boost/lexical_cast/try_lexical_convert.hpp:35, from /usr/bin/boost/lexical_cast.hpp:32, from /usr/bin/boost/math/constants/constants.hpp:18, from /root/work/mysql-arm/include/boost_1_59_0/patches/boost/geometry/util/math.hpp:28, from /root/work/mysql-arm/sql/gis_bg_traits.h:38, from /root/work/mysql-arm/sql/item_geofunc_internal.h:35, from /root/work/mysql-arm/sql/geometry_rtree.cc:16: /usr/bin/locale:1:1: error: stray â<80><98>\177â<80><99> in program ^?ELF^B^A^Aso.2^BX W H<8b>|$^Hè<93>úÿÿL<89>ÿè[^F^C¾ÿÿÿÿé^FÿÿÿH<89>ëéîþÿÿf<90>f.^O^_<84>tD<84>Àt@Áà^L%^O<84>ÿ^O<84>ÐÆ^AH<83>Á^A<8b>^U _ ëÀH<85>Û^O<84>ÎýÿÿI<89>Åé^Cþÿÿ1Òé.ÿÿÿ<8b>^U<81>^ H<8b><85>PßÿÿL<8d><85><80>ßÿÿL<89>êL)úL<89>ù¿@[@I<8b>6H<8d><95><80>ßÿÿ¿ ^ /usr/bin/locale:1:1: error: stray â<80><98>\2â<80><99> in program ./usr/bin/locale:1:1: error: stray â<80><98>\2â<80><99> in program /usr/bin/locale:1:1: error: stray â<80><98>\1â<80><99> in program /usr/bin/locale:1:1: error: stray â<80><98>\1â<80><99> in program /usr/bin/locale:1:8: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:1: error: stray â<80><98>\2â<80><99> in program /usr/bin/locale:1:18: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:20: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:1: error: stray â<80><98>\1â<80><99> in program /usr/bin/locale:1:22: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:27: error: stray â<80><98>@â<80><99> in program /usr/bin/locale:1:28: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:33: error: stray â<80><98>@â<80><99> in program /usr/bin/locale:1:34: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:1: error: stray â<80><98>\330â<80><99> in program /usr/bin/locale:1:1: error: stray â<80><98>\217â<80><99> in program /usr/bin/locale:1:43: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:53: error: stray â<80><98>@â<80><99> in program /usr/bin/locale:1:54: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:56: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:59: error: stray â<80><98>@â<80><99> in program /usr/bin/locale:1:60: warning: null character(s) ignored [enabled by default] /usr/bin/locale:1:1: error: stray â<80><98>\35â<80><99> in program . . . . . . . from /usr/bin/boost/lexical_cast/try_lexical_convert.hpp:35, from /usr/bin/boost/lexical_cast.hpp:32, from /usr/bin/boost/math/constants/constants.hpp:18, from /root/work/mysql-arm/include/boost_1_59_0/patches/boost/geometry/util/math.hpp:28, from /root/work/mysql-arm/sql/gis_bg_traits.h:38, from /root/work/mysql-arm/sql/item_geofunc_internal.h:35, from /root/work/mysql-arm/sql/geometry_rtree.cc:16: /usr/bin/locale:5:721: error: ‘libc’ does not name a type In file included from /usr/bin/boost/lexical_cast/detail/converter_lexical_streams.hpp:43:0, from /usr/bin/boost/lexical_cast/detail/converter_lexical.hpp:54, from /usr/bin/boost/lexical_cast/try_lexical_convert.hpp:35, from /usr/bin/boost/lexical_cast.hpp:32, from /usr/bin/boost/math/constants/constants.hpp:18, from /root/work/mysql-arm/include/boost_1_59_0/patches/boost/geometry/util/math.hpp:28, from /root/work/mysql-arm/sql/gis_bg_traits.h:38, from /root/work/mysql-arm/sql/item_geofunc_internal.h:35, from /root/work/mysql-arm/sql/geometry_rtree.cc:16: /usr/bin/locale:12:234: error: expected unqualified-id before numeric constant In file included from /usr/bin/boost/lexical_cast/detail/converter_lexical_streams.hpp:43:0, from /usr/bin/boost/lexical_cast/detail/converter_lexical.hpp:54, from /usr/bin/boost/lexical_cast/try_lexical_convert.hpp:35, from /usr/bin/boost/lexical_cast.hpp:32, from /usr/bin/boost/math/constants/constants.hpp:18, from /root/work/mysql-arm/include/boost_1_59_0/patches/boost/geometry/util/math.hpp:28, from /root/work/mysql-arm/sql/gis_bg_traits.h:38, from /root/work/mysql-arm/sql/item_geofunc_internal.h:35, from /root/work/mysql-arm/sql/geometry_rtree.cc:16: /usr/bin/locale:16:279: error: expected declaration before ‘}’ token make[2]: *** [sql/CMakeFiles/sql.dir/geometry_rtree.cc.o] Error 1 make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2 make: *** [all] Error 2
Navicat 连接不上虚拟机centos的mysql
[root@bogon ~]# service mysql start Redirecting to /bin/systemctl start mysql.service [root@bogon ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.45 MySQL Community Server (GPL) Copyright (c) 2000, 2019, 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> grant all privileges on *.* to root@"%" identified by "new_mysql"; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on *.* to root@"bogon" identified by "new_mysql"; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye [root@bogon ~]# iptables -F [root@bogon ~]# systemctl stop firewalld [root@bogon ~]# systemctl disable firewalld [root@bogon ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.131.131 netmask 255.255.255.0 broadcast 192.168.131.255 inet6 fe80::20c:29ff:fe4e:4a5b prefixlen 64 scopeid 0x20<link> ether 00:0c:29:4e:4a:5b txqueuelen 1000 (Ethernet) RX packets 284 bytes 28044 (27.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 395 bytes 31836 (31.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:d0:d8:4b txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@bogon ~]# ping www.baidu.com PING www.a.shifen.com (163.177.151.109) 56(84) bytes of data. 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=1 ttl=128 time=38.4 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=2 ttl=128 time=34.7 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=3 ttl=128 time=33.1 ms ^A64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=4 ttl=128 time=33.2 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=5 ttl=128 time=30.1 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=6 ttl=128 time=32.9 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=7 ttl=128 time=47.0 ms http://img.mukewang.com/climg/5d3d2999000169bb05660668.jpg 虚拟机网络是通的 Navicat的ip地址也没错 root的密码也没错 为什么就是连接不上呢?
在线等!!!linux服务器连接mysql5.7数据库报错 Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException
以下是服务器上的报错代码 ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573526989_375593.png) ``` >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上面的数据库). ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573527132_402324.png) 2,数据库工具使用无任何问题 ![图片说明](https://img-ask.csdn.net/upload/201911/12/1573527246_699888.png) 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> ``` 这个问题搞了很久了,主要就是不知道问题在哪,本地真的是没有任何问题,很多方式我也试过了.很头疼,求大佬帮忙解决
openssl和mysql冲突 ERR_remove_thread_state
openssl版本:openssl-1.1.0k mysql版本:mysql-5.7.27 静态库,编译报如下错误: /thirdparty/mysql/lib/libmysqlclient.a(ssl.cpp.o): In function `ERR_remove_thread_state': /export/home/pb2/build/sb_0-34537258-1560179931.8/mysql-5.7.27/extra/yassl/src/ssl.cpp:1619: multiple definition of `ERR_remove_thread_state' /home/lics/code/transfer/thirdparty/openssl/lib/libcrypto.a(err.o):err.c:(.text+0xb60): first defined here collect2: error: ld returned 1 exit status make[1]: [build] Error 1 (ignored) 请问有谁遇到过吗?
求大神帮忙分析一下mysql错误日志
本人小白,阿里云挂几个dx3 论坛,centOS7.2,mysql5.5.49,wdcp。近日出现mysql死掉的情况,有时重启mysql可以用几天,有时只半小时又死了。 170208 14:38:56 mysqld_safe Starting mysqld daemon with databases from /www/wdlinux/mysql-5.5.49/data 170208 14:38:56 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 170208 14:38:56 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 170208 14:38:56 [Note] /www/wdlinux/mysql-5.5.49/bin/mysqld (mysqld 5.5.49) starting as process 1619 ... 170208 14:38:56 [Note] Plugin 'FEDERATED' is disabled. 170208 14:38:57 InnoDB: The InnoDB memory heap is disabled 170208 14:38:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins 170208 14:38:57 InnoDB: Compressed tables use zlib 1.2.7 170208 14:38:57 InnoDB: Initializing buffer pool, size = 128.0M 170208 14:38:57 InnoDB: Completed initialization of buffer pool 170208 14:38:57 InnoDB: highest supported file format is Barracuda. 170208 14:38:57 InnoDB: Waiting for the background threads to start 170208 14:38:58 InnoDB: 5.5.49 started; log sequence number 1595745 170208 14:38:58 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 170208 14:38:58 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 170208 14:38:58 [Note] Server socket created on IP: '0.0.0.0'. 170208 14:38:58 [Note] Event Scheduler: Loaded 0 events 170208 14:38:58 [Note] /www/wdlinux/mysql-5.5.49/bin/mysqld: ready for connections.Version: '5.5.49' socket: '/tmp/mysql.sock' port: 3306 Source distribution 170208 15:02:51 [Note] /www/wdlinux/mysql-5.5.49/bin/mysqld: Normal shutdown 170208 15:02:51 [Note] Event Scheduler: Purging the queue. 0 events 170208 15:02:51 InnoDB: Starting shutdown... 170208 15:02:51 InnoDB: Shutdown completed; log sequence number 1595745 170208 15:02:51 [Note] /www/wdlinux/mysql-5.5.49/bin/mysqld: Shutdown complete
Mantis提交问题时描述和摘要部分中文乱码怎么办?
![图片说明](https://img-ask.csdn.net/upload/201910/24/1571906618_494825.png) 我想请问有人知道这部分(只有摘要和内容,如果第一次添加评论也会乱码)中文乱码怎么解决吗? 我的Mantis版本为2.22.0 php版本7.3.5 其他的地方中文都不会乱码,而且也修改了mysql数据库的默认编码问utf8 最关键是只有在提交问题的时候才会乱码,如果点击问题重新编辑保存就不会, 去查看数据库也是前者是乱码的,后者是正常的。 所以我认为应不是数据库配置问题,是mantis配置出错了 在config_default_inc.php 和config_inc.php里面都改了语言设置为chinese_simplified 我的mantis是在Centos6.5的服务器上跑的 试了一下1.3.1版本和php5.4的mantis就不会出现这种问题,但界面太粗糙了,所以还是选择去解决这个版本的
centos7上用rpmbuild建立rpm安装包问题(急)
centos7.1 php-5.6.25 $ ls rpmbuild/ BUILD BUILDROOT RPMS SOURCES SPECS SRPMS $cat rpmbuild/SPECS/php.spec Name: php Version: 5.6.25 Release: 1%{?dist} Summary: compiled from 5.6.25 by Kevin Group: System Environment/Daemons License: GPL URL: https://secure.php.net Source0: php-5.6.25.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: gcc, gcc-c++, openssl-devel Requires: wireshark-gnome %description php server. Compiled from 5.6.25 by Kevin %prep %setup -q %build ./configure '--with-libdir=lib64' '--prefix=/usr/local/php5.6' '--with-fpm-systemd' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-pdo-mysql' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir' '--with-curl' '--with-openssl' '--with-mcrypt' '--enable-zip' '--enable-intl' make %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %defattr(-,root,root,-) /usr/local/php5.6/bin/* /usr/local/php5.6/sbin/* /usr/local/php5.6/include/* /usr/local/php5.6/php/php/fpm/* /usr/local/php5.6/php/man/man1/* /usr/local/php5.6/php/man/man8/* /usr/local/php5.6/lib/php/* /usr/local/php5.6/lib/php/extensions/* /usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/* /usr/local/php5.6/lib/php/build/* /usr/local/php5.6/lib/php/build/shtool/* /usr/local/php5.6/lib/php/.registry/* /usr/local/php5.6/lib/php/.channels/* /usr/local/php5.6/lib/php/Archive/* /usr/local/php5.6/lib/php/doc/* /usr/local/php5.6/lib/php/doc/Archive_Tar/* /usr/local/php5.6/lib/php/doc/Archive_Tar/docs/* /usr/local/php5.6/lib/php/doc/Structures_Graph/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/* /usr/local/php5.6/lib/php/doc/Structures_Graph/docs/tutorials/Structures_Graph/* /usr/local/php5.6/lib/php/doc/Structures_Graph/LICENSE/* /usr/local/php5.6/lib/php/doc/XML_Util/* /usr/local/php5.6/lib/php/doc/XML_Util/examples/* /usr/local/php5.6/lib/php/doc/PEAR/* /usr/local/php5.6/lib/php/doc/PEAR/LICENSE/* /usr/local/php5.6/lib/php/doc/PEAR/INSTALL/* /usr/local/php5.6/lib/php/Console/* /usr/local/php5.6/lib/php/test/* /usr/local/php5.6/lib/php/test/Console_Getopt/* /usr/local/php5.6/lib/php/test/Console_Getopt/tests/* /usr/local/php5.6/lib/php/test/Structures_Graph/* /usr/local/php5.6/lib/php/test/Structures_Graph/tests/* /usr/local/php5.6/lib/php/test/XML_Util/* /usr/local/php5.6/lib/php/test/XML_Util/tests/* /usr/local/php5.6/lib/php/Structures/* /usr/local/php5.6/lib/php/Structures/Graph/* /usr/local/php5.6/lib/php/Structures/Graph/Manipulator/* /usr/local/php5.6/lib/php/XML/* /usr/local/php5.6/lib/php/OS/* /usr/local/php5.6/lib/php/PEAR/* /usr/local/php5.6/lib/php/PEAR/ChannelFile/* /usr/local/php5.6/lib/php/PEAR/Command/* /usr/local/php5.6/lib/php/PEAR/Downloader/* /usr/local/php5.6/lib/php/PEAR/Frontend/* /usr/local/php5.6/lib/php/PEAR/Installer/* /usr/local/php5.6/lib/php/PEAR/Installer/Role/* /usr/local/php5.6/lib/php/PEAR/PackageFile/* /usr/local/php5.6/lib/php/PEAR/PackageFile/Generator/* /usr/local/php5.6/lib/php/PEAR/PackageFile/Parser/* /usr/local/php5.6/lib/php/PEAR/PackageFile/v2/* /usr/local/php5.6/lib/php/PEAR/REST/* /usr/local/php5.6/lib/php/PEAR/Task/* /usr/local/php5.6/lib/php/PEAR/Task/Postinstallscript/* /usr/local/php5.6/lib/php/PEAR/Task/Replace/* /usr/local/php5.6/lib/php/PEAR/Task/Unixeol/* /usr/local/php5.6/lib/php/PEAR/Task/Windowseol/* /usr/local/php5.6/lib/php/PEAR/Validator/* /usr/local/php5.6/lib/php/data/* /usr/local/php5.6/lib/php/data/PEAR/* %config /usr/local/php5.6/etc/* /usr/local/php5.6/var/run/* /usr/local/php5.6/lib/* %dir /usr/local/php5.6/var/log/ %post cp /usr/local/php5.6/etc/php-fpm.conf.default /usr/local/php5.6/etc/php-fpm.conf ln -s /usr/local/php5.6/bin/php /usr/bin/php %changelog * Tue Aug 30 2016 Kevin<kevin_liao@163.com> 5.6.25 - first rpm from php-5.6.25 然后用一个user用户为centos,没在root下执行 $ rpmbuild -ba rpmbuild/SPECS/php.spec 最后报错 Build complete. Don't forget to run 'make test'. + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.QjJHDq + umask 022 + cd /home/centos/rpmbuild/BUILD + '[' /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 '!=' / ']' + rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 ++ dirname /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + mkdir -p /home/centos/rpmbuild/BUILDROOT + mkdir /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + cd php-5.6.25 + rm -rf /home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 + make install DESTDIR=/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64 Installing shared extensions: /usr/local/php5.6/lib/php/extensions/no-debug-non-zts-20131226/ Installing PHP CLI binary: /usr/local/php5.6/bin/ Installing PHP CLI man page: /usr/local/php5.6/php/man/man1/ Installing PHP FPM binary: /usr/local/php5.6/sbin/ Installing PHP FPM config: /usr/local/php5.6/etc/ Installing PHP FPM man page: /usr/local/php5.6/php/man/man8/ Installing PHP FPM status page: /usr/local/php5.6/php/php/fpm/ Installing PHP CGI binary: /usr/local/php5.6/bin/ Installing PHP CGI man page: /usr/local/php5.6/php/man/man1/ Installing build environment: /usr/local/php5.6/lib/php/build/ Installing header files: /usr/local/php5.6/include/php/ Installing helper programs: /usr/local/php5.6/bin/ program: phpize program: php-config Installing man pages: /usr/local/php5.6/php/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/php5.6/lib/php/ [PEAR] Archive_Tar - already installed: 1.4.0 [PEAR] Console_Getopt - already installed: 1.4.1 [PEAR] Structures_Graph- already installed: 1.1.1 [PEAR] XML_Util - already installed: 1.3.0 [PEAR] PEAR - already installed: 1.10.1 Wrote PEAR system config file at: /usr/local/php5.6/etc/pear.conf You may want to add: /usr/local/php5.6/lib/php to your php.ini include_path /home/centos/rpmbuild/BUILD/php-5.6.25/build/shtool install -c ext/phar/phar.phar /usr/local/php5.6/bin ln -s -f phar.phar /usr/local/php5.6/bin/phar Installing PDO headers: /usr/local/php5.6/include/php/ext/pdo/ + /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/centos/rpmbuild/BUILD/php-5.6.25 find: '/home/centos/rpmbuild/BUILDROOT/php-5.6.25-1.el7.centos.x86_64': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.QjJHDq (%install)
hive使用schematool初始化时出错,./schematool -dbType mysql -initSchema,?
![图片说明](https://img-ask.csdn.net/upload/201903/11/1552301392_336852.png) [root@cnsz22VLK13515:/opt/hive/apache-hive-2.3.4-bin/bin]#./schematool -dbType mysql -initSchema SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/hive/apache-hive-2.3.4-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-2.5.1/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Exception in thread "main" java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/hadoop/crypto/key/KeyProvider at org.apache.hadoop.hive.shims.ShimLoader.getHadoopShims(ShimLoader.java:91) at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:95) at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:82) at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1117) 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:498) at org.apache.hadoop.util.RunJar.main(RunJar.java:212) Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/crypto/key/KeyProvider at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.apache.hadoop.hive.shims.ShimLoader.createShim(ShimLoader.java:129) at org.apache.hadoop.hive.shims.ShimLoader.loadShims(ShimLoader.java:124) at org.apache.hadoop.hive.shims.ShimLoader.getHadoopShims(ShimLoader.java:88) ... 8 more Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.crypto.key.KeyProvider at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 13 more 求大神解决,谢谢啦。
急求帮助,centOS下tomcat的java进程无故终止
求助! 目前环境centOS6.6+Nginx1.8.0+tomcat7.0.42+mysql5.6.24 另外还装了安全狗和clamd杀毒软件。 碰到的问题是tomcat的java进程隔几天会无故终止。tomcat的catalina日志里没有 tomcat停止的日志。操作系统日志/var/adm/messages里也没有tomcat的java进程停止的日志。 tomcat的home目录下也没有找到java虚拟机崩溃的日志。 打开进程日志,看到tomcat的java进程收到终止信号停止,java进程有X标志。 cat root __ 0.00 secs Thu Jul 30 09:48 sh root __ 0.00 secs Thu Jul 30 09:48 egrep root __ 0.00 secs Thu Jul 30 09:48 cat root __ 0.00 secs Thu Jul 30 09:48 sh root __ 0.00 secs Thu Jul 30 09:48 awk root __ 0.00 secs Thu Jul 30 09:48 head root __ 0.00 secs Thu Jul 30 09:48 cat root __ 0.00 secs Thu Jul 30 09:48 ## java S X root __ 2728.72 secs Wed Jul 29 10:38 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 du root __ 0.00 secs Thu Jul 30 09:48 sh root __ 0.00 secs Thu Jul 30 09:48 awk root __ 0.00 secs Thu Jul 30 09:48 head root __ 0.00 secs Thu Jul 30 09:48 cat root __ 0.00 secs Thu Jul 30 09:48 sh root __ 0.00 secs Thu Jul 30 09:48 awk root __ 0.00 secs Thu Jul 30 09:48 head root __ 0.00 secs Thu Jul 30 09:48 cat root __ 0.00 secs Thu Jul 30 09:48 sh root __ 0.00 secs Thu Jul 30 09:48 grep root __ 0.00 secs Thu Jul 30 09:48 grep root __ 0.00 secs Thu Jul 30 09:48 ps S root __ 0.02 secs Thu Jul 30 09:48 但是在这个时间段并没有kill发送信号,那这个信号是由哪个进程发起的,有没有办法查看。 我最初怀疑过操作系统内存耗尽,tomcat进程被OOM_killer杀死了,但是操作系统日志/var/adm/messages里会有out of memory杀进程的日志,我在虚拟机上测试,/var/adm/messages里是有相应日志。下面是free -m的输出: total used free shared buffers cached Mem: 32085 26304 5780 1 258 21274 -/+ buffers/cache: 4771 27313 Swap: 16111 50 16061 也怀疑过ssh连接异常关闭导致tomcat进程被杀,但是我在虚拟机上并没有模拟重现故障。 因为centOS ssh登录采用公钥秘钥的方式,并且在故障时间段进程日志里并没有找到kill命令,暂时排除人为强杀进程的情况。 不知道现在的情况我能通过什么方式来定位故障原因。求指点。 另外在tomcat的localhost日志里,有类似如下的异常日志: Jul 30, 2015 12:14:27 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspException: Problem accessing the absolute URL "http://www.d1wudal.com:80/getHomeItem.action?navBz=1". java.io.FileNotFoundException: http://www.d1wudal.com:80/getHomeItem.action?navBz=1] with root cause java.io.FileNotFoundException: http://www.d1wudal.com:80/getHomeItem.action?navBz=1 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625) at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:331) at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:241) at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161) at org.apache.jsp.index_jsp._jspx_meth_c_005fimport_005f0(index_jsp.java:177) at org.apache.jsp.index_jsp._jspService(index_jsp.java:109) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96) at com.st.core.filter.Struts2Filter.doFilter(Struts2Filter.java:24) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 我在虚拟机上模拟重现了这个异常,是由客户端的异常请求造成的。我也怀疑过遭到了类似DDOS的攻击,但是查看了系统的连接数量应该不足以让tomcat进程终止。 麻烦帮忙分析下!
安装CDH过程中无法安装cloudera-manager-agent
系统是CENTOS7.2,安装CDH5.11.1。为什么在安装的时候老是会报错有依赖包没装?CM WEB端或者直接系统中安装都 不会。到底是哪里出问题了,有大神帮忙 吗》》???谢谢 [root@master yum.repos.d]# yum -y install cloudera-manager-agent.x86_64 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help). --> Running transaction check ---> Package cloudera-manager-agent.x86_64 0:5.11.1-1.cm5111.p0.9.el7 will be installed --> Processing Dependency: python-psycopg2 for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 --> Processing Dependency: openssl-devel for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 --> Processing Dependency: MySQL-python for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 --> Processing Dependency: /lib/lsb/init-functions for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 --> Processing Dependency: /lib/lsb/init-functions for package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 --> Finished Dependency Resolution Error: Package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 (cloudera-manager) Requires: MySQL-python Error: Package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 (cloudera-manager) Requires: openssl-devel Error: Package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 (cloudera-manager) Requires: python-psycopg2 Error: Package: cloudera-manager-agent-5.11.1-1.cm5111.p0.9.el7.x86_64 (cloudera-manager) Requires: /lib/lsb/init-functions You could try using --skip-broken to work around the problem ** Found 4 pre-existing rpmdb problem(s), 'yum check' output follows: MariaDB-client-10.2.1-1.el7.centos.x86_64 has missing requires of MariaDB-common MariaDB-server-10.2.1-1.el7.centos.x86_64 has missing requires of MariaDB-common 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit) 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
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) 有没有大牛知道我问题出在哪里?感激不尽!
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
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匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
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
漫话:什么是平衡(AVL)树?这应该是把AVL树讲的最好的文章了
这篇文章通过对话的形式,由浅入深带你读懂 AVL 树,看完让你保证理解 AVL 树的各种操作,如果觉得不错,别吝啬你的赞哦。 1、若它的左子树不为空,则左子树上所有的节点值都小于它的根节点值。 2、若它的右子树不为空,则右子树上所有的节点值均大于它的根节点值。 3、它的左右子树也分别可以充当为二叉查找树。 例如: 例如,我现在想要查找数值为14的节点。由于二叉查找树的特性,我们可...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
开源并不是你认为的那些事
点击上方蓝字 关注我们开源之道导读所以 ————想要理清开源是什么?先要厘清开源不是什么,名正言顺是句中国的古代成语,概念本身的理解非常之重要。大部分生物多样性的起源,...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
《C++ Primer》学习笔记(六):C++模块设计——函数
专栏C++学习笔记 《C++ Primer》学习笔记/习题答案 总目录 https://blog.csdn.net/TeFuirnever/article/details/100700212 —————————————————————————————————————————————————————— 《C++ Primer》习题参考答案:第6章 - C++模块设计——函数 文章目录专栏C+...
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
so easy! 10行代码写个"狗屁不通"文章生成器
前几天,GitHub 有个开源项目特别火,只要输入标题就可以生成一篇长长的文章。背后实现代码一定很复杂吧,里面一定有很多高深莫测的机器学习等复杂算法不过,当我看了源代码之后这程序不到50
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
相关热词 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件 c#注册dll文件 c#安装.net
立即提问