Tag Archives: mysql

Python: How to Solve mysqlclient Install Error in Mac

It’s finally solved after many hardships. Please refer to the notes of Niu Ren and record it

Install brew

First, install brew and Baidu. There are many tutorials

Install MySQL

#Install
brew install mysql

#Configure environment variables
echo'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile

#Make environment variables take effect
source ~/.bash_profile

#Start mysql service through script
mysql.server start

#Start mysql and set to boot
brew services start mysql

#Initialization, set password
mysql_secure_installation

ya..... bin% mysql_secure_installation
Enter password:

Securing the MySQL server deployment.


VALIDATE PASSWORD PLUGIN can be used to test passwords //Password verification plug-in, in order to improve security, you need to verify the password
and improve security. It checks the strength of password // It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin? //Prompt to install the password verification plugin

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy: //Three levels of password validation policy

LOW Length >= 8 //The minimum length is greater than or equal to 8 characters
MEDIUM Length >= 8, numeric, mixed case, and special characters //Numbers, letters, and special characters are mixed, the specific ones should be at least 1 number, 1 letter, 1 special character, and the length should not exceed 32 characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file // The most stringent, plus, the dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 //Here I choose 2 MEDIUM
Using existing password for root.

Estimated strength of the password: 50 //Here is also the rating of password strength
Change the password for root ?((Press y|Y for Yes, any other key for No): y

New password: //Password

Re-enter new password:

Estimated strength of the password: 50
Do you wish to continue with the password provided? (Press y|Y for Yes, any other key for No): y //Prompt to use the password you just entered?
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password: //Password

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No): y
By default, a MySQL installation has an anonymous user, //By default, MySQL has an anonymous user,
allowing anyone to log into MySQL without having to have //This anonymous user does not have to be created for them by a user. An anonymous user allows anyone to log into MySQL,
a user account created for them. This is intended only for //This is just to facilitate test use
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production //When using in a formal environment, it is recommended that you remove them
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No): y //Prompt to remove anonymous users
Success.

Normally, root should only be allowed to connect from //Under normal circumstances, root users are only allowed to log in using "localhost",
'localhost'. This ensures that someone cannot guess at // to ensure that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No): n //

 ... skipping.
By default, MySQL comes with a database named'test' that //By default, there is a test library in the MySQL database that can be accessed by any user.
anyone can access. This is also intended only for testing, //This is also intended only for testing
and should be removed before moving into a production // in a formal environment, should be removed
environment.

Remove test database and access to it?(Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes                       //Refresh the permission table to ensure that all modifications can take effect immediately
made so far will take effect immediately.

Reload privilege tables now?(Press y|Y for Yes, any other key for No) : y
Success.

All done! 

Install mysql-connector-c

brew install mysql-connector-c

Installing Xcode-

xcode-select --install

Install OpenSSL

brew install openssl

After installation, the terminal will display the method of configuring environment variables

If you need to have openssl@3 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@3 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"

Unlink MySQL and the linked MySQL connector mysql-connector-c

brew unlink mysql
brew link --overwrite mysql-connector-c

As shown in the figure, mysql-connector-c has a warning
warning: MySQL client is keg only and must be linked with -- force.
execute
brew link -- overwrite mysql-connector-c -- force

Install mysqlclient

Using PIP install mysqlclient will not cause any errors

Connect MySQL again

Do the opposite of unlinking MySQL and the linked MySQL connector mysql-connector-c:

brew unlink mysql-connector-c
brew link --overwrite mysql --force

[Solved] mysqldump Command Error: Got error: 2002: “Can‘t connect to server on ‘127.0.0.1‘ (36)“ when trying to connect

1. When executing mysqldump command for data backup, the error information is as follows:

~ % mysqldump -udbuser -p123456 -h127.0.0.1 school student  > school_student.sql 
mysqldump: Got error: 2002: "Can't connect to server on '127.0.0.1' (36)" when trying to connect

2. Then try the command line to connect to the database, which is also an error

~ % mysql -udbuser -p123456 -h127.0.0.1
ERROR 2002 (HY000): Can't connect to server on '127.0.0.1' (36)

3. After checking the MySQL service result, I remembered that I used ‘mysql. Server start’ to start the database. This cannot follow the system startup. Each time I restart the Mac, I need to run it manually. You can use brew services to start MariaDB   Start the service with the system.

~ % mysql.server start
Starting MariaDB
.211111 16:04:44 mysqld_safe Logging to '/usr/local/var/mysql/xiaokang.err'.
211111 16:04:44 mysqld_safe Starting mariadbd daemon with databases from /usr/local/var/mysql
 SUCCESS! 

4. After successful restart, execute mysqldump again for backup

Solution to communication link failure with error in idea startup project

Problem description

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Solution

Option 1   Tomcat VM configuration parameters: – DJava. Net. Preferipv4stack = true

Option 2   ① Nginx configuring agent MySQL:

    ② Modify database connection: spring. Datasource. Url = JDBC: mysql://localhost:9999/demo?characterEncoding=utf8

Reference from:

https://blog.csdn.net/baidu_21349635/article/details/121032229
https://adong.blog.csdn.net/article/details/111501253

MYSQL Error: Can‘t find error-message file [How to Solve]

Installing MySQL
is running

mysqld --initialize --console

An error was encountered while

2021-11-06T18:04:30.907573Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'C: ofterwaresetting\mySQL\mysql-8.0.11-winx64 hare\english\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

After checking many tutorials, I finally found that there was a problem with the escape character:
https://bugs.mysql.com/bug.php?id=90364

In short, change the path to double slash \ in my.ini file,
for example:

basedir=C:\\softerwaresetting\\mySQL\\mysql-8.0.11-winx64
datadir=C:\\softerwaresetting\\mySQL\\mysql-8.0.11-winx64\\Data
lc-messages-dir=C:\\softerwaresetting\\mySQL\\mysql-8.0.11-winx64\\share\\english

yum Error: error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run data……

1. On Linux server, execute the yum command and report an error as follows:
[root@isTester-Idoxu ~]# yum install nodejs
error: rpmdb: BDB0113 Thread/process 19512/140292738050112 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 – (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
2. Reason:
The rpm database is damaged.
3. Solution:
Just modify the database,
1)执行命令cd /var/lib/rpm
[root@isTester-Idoxu ~]# cd /var/lib/rpm
[root@isTester-Idoxu rpm]# ls
Basenames Conflictname __db.001 __db.002 __db.003 Dirnames Group Installtid Name Obsoletename Packages Providename Requirename Sha1header Sigmd5 Triggername
2) View
[root@isTester-Idoxu rpm]# ll
total 142484
-rw-r–r–. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r–r–. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r–r– 1 root root 286720 Nov 8 17:55 __db.001
-rw-r–r– 1 root root 90112 Nov 8 17:55 __db.002
-rw-r–r– 1 root root 1318912 Nov 8 17:55 __db.003
-rw-r–r–. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r–r–. 1 root root 20480 Nov 4 2020 Group
-rw-r–r–. 1 root root 16384 Nov 4 2020 Installtid
-rw-r–r–. 1 root root 36864 Nov 4 2020 Name
-rw-r–r–. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r–r–. 1 root root 136822784 Nov 4 2020 Packages
-rw-r–r–. 1 root root 1888256 Nov 4 2020 Providename
-rw-r–r–. 1 root root 253952 Nov 4 2020 Requirename
-rw-r–r–. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r–r–. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r–r–. 1 root root 8192 Oct 30 2020 Triggername
3) Delete the damaged database file
[root@isTester-Idoxu rpm]# rm -rf __db.00*
[root@isTester-Idoxu rpm]# ll
total 140964
-rw-r–r–. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r–r–. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r–r–. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r–r–. 1 root root 20480 Nov 4 2020 Group
-rw-r–r–. 1 root root 16384 Nov 4 2020 Installtid
-rw-r–r–. 1 root root 36864 Nov 4 2020 Name
-rw-r–r–. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r–r–. 1 root root 136822784 Nov 4 2020 Packages
-rw-r–r–. 1 root root 1888256 Nov 4 2020 Providename
-rw-r–r–. 1 root root 253952 Nov 4 2020 Requirename
-rw-r–r–. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r–r–. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r–r–. 1 root root 8192 Oct 30 2020 Triggername
4) Re-create the database file
[root@isTester-Idoxu rpm]# rpm –rebuilddb
[root@isTester-Idoxu rpm]# yum
Loaded plugins: fastestmirror, langpacks
You need to give some command
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package’s dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
fs Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.
fssnapshot Creates filesystem snapshots, or lists/deletes current snapshots.
groups Display, or use, the groups information
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
langavailable Check available languages
langinfo List languages information
langinstall Install appropriate language packs for a language
langlist List installed languages
langremove Remove installed language packs for a language
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repo-pkgs Treat a repo. as a group of packages, so we can install/remove all of them
repolist Display the configured software repositories
search Search package details for the given string
shell Run an interactive yum shell
swap Simple way to swap packages, instead of using shell
update Update a package or packages on your system
update-minimal Works like upgrade, but goes to the ‘newest’ package match which fixes a problem that affects your system
updateinfo Acts on repository update information
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos.
Options:
-h, –help show this help message and exit
-t, –tolerant be tolerant of errors
-C, –cacheonly run entirely from system cache, don’t update cache
-c [config file], –config=[config file]
config file location
-R [minutes], –randomwait=[minutes]
maximum command wait time
-d [debug level], –debuglevel=[debug level]
debugging output level
–showduplicates show duplicates, in repos, in list/search commands
-e [error level], –errorlevel=[error level]
error output level
–rpmverbosity=[debug level name]
debugging output level for rpm
-q, –quiet quiet operation
-v, –verbose verbose operation
-y, –assumeyes answer yes for all questions
–assumeno answer no for all questions
–version show Yum version and exit
–installroot=[path] set install root
–enablerepo=[repo] enable one or more repositories (wildcards allowed)
–disablerepo=[repo] disable one or more repositories (wildcards allowed)
-x [package], –exclude=[package]
exclude package(s) by name or glob
–disableexcludes=[repo]
disable exclude from main, for a repo or for
everything
–disableincludes=[repo]
disable includepkgs for a repo or for everything
–obsoletes enable obsoletes processing during updates
–noplugins disable Yum plugins
–nogpgcheck disable gpg signature checking
–disableplugin=[plugin]
disable plugins by name
–enableplugin=[plugin]
enable plugins by name
–skip-broken skip packages with depsolving problems
–color=COLOR control whether color is used
–releasever=RELEASEVER
set value of $releasever in yum config and repo files
–downloadonly don’t update, just download
–downloaddir=DLDIR specifies an alternate directory to store packages
–setopt=SETOPTS set arbitrary config and repo options
–bugfix Include bugfix relevant packages, in updates
–security Include security relevant packages, in updates
–advisory=ADVS, –advisories=ADVS
Include packages needed to fix the given advisory, in
updates
–bzs=BZS Include packages needed to fix the given BZ, in
updates
–cves=CVES Include packages needed to fix the given CVE, in
updates
–sec-severity=SEVS, –secseverity=SEVS
Include security relevant packages matching the
severity, in updates
Plugin Options:
5) Check whether the creation is successful
[root@isTester-Idoxu rpm]# ll
total 86052
-rw-r–r– 1 root root 2846720 Nov 8 17:58 Basenames
-rw-r–r– 1 root root 8192 Nov 8 17:58 Conflictname
-rw-r–r– 1 root root 286720 Nov 8 17:58 __db.001
-rw-r–r– 1 root root 90112 Nov 8 17:58 __db.002
-rw-r–r– 1 root root 57344 Nov 8 17:58 __db.003
-rw-r–r– 1 root root 1327104 Nov 8 17:58 Dirnames
-rw-r–r– 1 root root 24576 Nov 8 17:58 Group
-rw-r–r– 1 root root 16384 Nov 8 17:58 Installtid
-rw-r–r– 1 root root 40960 Nov 8 17:58 Name
-rw-r–r– 1 root root 16384 Nov 8 17:58 Obsoletename
-rw-r–r– 1 root root 81248256 Nov 8 17:58 Packages
-rw-r–r– 1 root root 1957888 Nov 8 17:58 Providename
-rw-r–r– 1 root root 217088 Nov 8 17:58 Requirename
-rw-r–r– 1 root root 69632 Nov 8 17:58 Sha1header
-rw-r–r– 1 root root 45056 Nov 8 17:58 Sigmd5
-rw-r–r– 1 root root 8192 Nov 8 17:58 Triggername
Done!

[Solved] ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate

The MySQL table structure is as follows:

mysql> select * from fruits ;
+------+------+------------+---------+
| f_id | s_id | f_name     | f_price |
+------+------+------------+---------+
| a1   |  101 | apple      |    5.20 |
| a2   |  103 | apricot    |    2.20 |
| b1   |  101 | blackberry |   10.20 |
| b2   |  104 | berry      |    7.60 |
| b5   |  107 | xxxx       |    3.60 |
| bs1  |  102 | orange     |   11.20 |
| bs2  |  105 | melon      |    8.20 |
| c0   |  101 | cherry     |    3.20 |
| l2   |  104 | lemon      |    6.40 |
| m1   |  106 | mango      |   15.70 |
| m2   |  105 | xbabay     |    2.60 |
| m3   |  105 | xxtt       |   11.60 |
| o2   |  103 | coconut    |    9.20 |
| t1   |  102 | banana     |   10.30 |
| t2   |  102 | grape      |    5.30 |
| t4   |  107 | xbababa    |    3.60 |
+------+------+------------+---------+

According to s_ ID groups the table data, and the error message is as follows

mysql> select * from fruits group by s_id;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
 'exercise.fruits.f_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible 
 with sql_mode=only_full_group_by

Query SQL_Mode mode

mysql> select @@session.sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@session.sql_mode                                                                                                                        |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,
ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+

Reason: only is added after MySQL 5.7_full_group_By roughly means that the column you select must be included in group by (for example, select a, B from table, group by a, B;), or you are an aggregate column, such as sum(), avg(), max(). The
official website says that SQL mode affects the syntax supported by MySQL and the data verification checks it performs, This makes it easier to use MySQL in different environments and other database servers

Official website reference link: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-setting

Solution:

1. It is found that the set global setting in MySQL does not take effect and cannot be set under my.cnf

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

2. Query again is normal

mysql> select * from fruits group by s_id,f_name;
+------+------+------------+---------+
| f_id | s_id | f_name     | f_price |
+------+------+------------+---------+
| a1   |  101 | apple      |    5.20 |
| b1   |  101 | blackberry |   10.20 |
| c0   |  101 | cherry     |    3.20 |
| t1   |  102 | banana     |   10.30 |
| t2   |  102 | grape      |    5.30 |
| bs1  |  102 | orange     |   11.20 |
| a2   |  103 | apricot    |    2.20 |
| o2   |  103 | coconut    |    9.20 |
| b2   |  104 | berry      |    7.60 |
| l2   |  104 | lemon      |    6.40 |
| bs2  |  105 | melon      |    8.20 |
| m2   |  105 | xbabay     |    2.60 |
| m3   |  105 | xxtt       |   11.60 |
| m1   |  106 | mango      |   15.70 |
| t4   |  107 | xbababa    |    3.60 |
| b5   |  107 | xxxx       |    3.60 |
+------+------+------------+---------+

sql_Mode interpretation:

ONLY_FULL_GROUP_BY: For the GROUP BY aggregation operation, if the column in the SELECT is not in the GROUP
Appears in BY, then this SQL is illegal, because the column is not in the GROUP BY clause
 
NO_AUTO_VALUE_ON_ZERO: This value affects the insertion of self-growing columns. By default, inserting 0 or NULL means that the next self-increasing value is generated. If the user
Hope that the inserted value is 0, and the column is self-increasing, then this option is useful.
 
STRICT_TRANS_TABLES: In this mode, if a value cannot be inserted into a transaction table, the current operation is interrupted, and there is no restriction on non-transactional tables
NO_ZERO_IN_DATE: In strict mode, the date and month are not allowed to be zero
 
NO_ZERO_DATE: Set this value. The mysql database does not allow the insertion of a zero date. Inserting a zero date will throw an error instead of a warning.
 
ERROR_FOR_DIVISION_BY_ZERO: During INSERT or UPDATE, if the data is divided by zero, an error is generated instead of a warning. like
If the mode is not given, then MySQL returns NULL when the data is divided by zero
 
NO_AUTO_CREATE_USER: prohibit GRANT from creating users with empty passwords
 
NO_ENGINE_SUBSTITUTION:
If the required storage engine is disabled or not compiled, then an error is thrown. When this value is not set, replace with the default storage engine and throw an exception
 
PIPES_AS_CONCAT:
Treat "||" as a string concatenation operator instead of an OR operator, which is the same as the Oracle database and similar to the string concatenation function Concat
 
ANSI_QUOTES: When ANSI_QUOTES is enabled, double quotes cannot be used to quote a string because it is interpreted as an identifier

[Solved] MYSQL Master-Slave slave I/o for channel, error_code 1045

1. Background

A few days ago, a friend restarted the master database. The master-slave link was broken and “error_code 1045” was reported.

2. Solve

From the point of view of the error, it is because of a problem with the link authentication. You can compare whether the password is consistent with the password of the master_info file of the slave library. Most of them are caused by inconsistent passwords for some reason.

Solution:

stop slave;
change master to master_password='new_password';
start slave;

Hive install initialization error: Error: Duplicate key name ‘PCS_STATS_IDX‘ (state=42000,code=1061)

Error log

[root@mihaoyu151 conf]# schematool -dbType mysql -initSchema
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
21/11/09 14:25:20 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
21/11/09 14:25:20 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.user does not exist
21/11/09 14:25:20 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.password does not exist
Metastore connection URL:	 jdbc:mysql://192.168.133.151:3306/hive151?createDatabaseIfNotExist=true
Metastore Connection Driver :	 com.mysql.jdbc.Driver
Metastore connection User:	 root
Starting metastore schema initialization to 1.1.0-cdh5.14.2
Initialization script hive-schema-1.1.0.mysql.sql
Error: Duplicate key name 'PCS_STATS_IDX' (state=42000,code=1061)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
*** schemaTool failed ***

Error reporting reason

Hive database already exists in MySQL

Solution:

Delete hive database in MySQL

[root@mihaoyu151 soft]# mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 135
Server version: 5.7.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive151            |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

mysql> drop database hive151;
Query OK, 54 rows affected (0.13 sec)

mysql> exit;
Bye

[root@mihaoyu151 soft]# schematool -dbType mysql -initSchema
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/opt/soft/jdk180/bin:/opt/soft/zookeeper345/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/jdk180/bin:/opt/soft/hadoop260/sbin:/opt/soft/hadoop260/bin:/opt/soft/zookeeper345/bin:/opt/soft/hive110/bin)
21/11/09 14:30:24 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
21/11/09 14:30:24 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.user does not exist
21/11/09 14:30:24 WARN conf.HiveConf: HiveConf of name hive.server2.thrift.client.password does not exist
Metastore connection URL:	 jdbc:mysql://192.168.133.151:3306/hive151?createDatabaseIfNotExist=true
Metastore Connection Driver :	 com.mysql.jdbc.Driver
Metastore connection User:	 root
Starting metastore schema initialization to 1.1.0-cdh5.14.2
Initialization script hive-schema-1.1.0.mysql.sql
Initialization script completed
schemaTool completed

net start mysql System error 2 has occurred. The system cannot find the file specified.

https://www.jianshu.com/p/6d8ed7c36e6f
368160;-net start mysql29616;- 38169;- 35823s;

error 2 has occurred.  The system cannot find the file specified.

Solution:
run as an administrator and enter the installation path of CD + MySQL bin directory on the command line

C:\WINDOWS\system32>cd C:\softerwaresetting\mySQL\mysql-8.0.11-winx64\bin

C:\softerwaresetting\mySQL\mysql-8.0.11-winx64\bin>mysqld --remove
Service successfully removed.

C:\softerwaresetting\mySQL\mysql-8.0.11-winx64\bin>mysqld --install
Service successfully installed.

C:\softerwaresetting\mySQL\mysql-8.0.11-winx64\bin>net start mysql
The MySQL service is starting.
The MySQL service was started successfully.

Error: failed dependencies error during MySQL installation

When installing MySQL on Linux system, error: failed dependencies error occurs when installing services

I inquired about the solution on the Internet. There are so many dependencies that need to be installed. It is suggested to download them again. Personally, I think it is a waste of time. Another solution is to add -- nodeps -- force , which is successfully solved


after the installation is completed, an error occurs again when starting the MySQL service

unfortunately, to run 32-bit programs on a 64 bit system, you need to install the 32-bit lib library. Or download a 64 bit version.

Error attempting to get column ‘xxxxx’ from result set — after Lombok is annotated with builder, mybatis cannot recognize the correct type of field

Pit stepping record – after Lombok is annotated with builder, mybatis cannot recognize the correct type of field

After adding Lombok to the entity class, sometimes we will use @ builder annotation, so we don’t need to write too many set methods to define the attribute content, which makes our code more elegant. Once the @ builder annotation is added to the entity class, it will cause problems in our mybatis mapping database fields

The questions are as follows

org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'username' from result set.  Cause: java.sql.SQLDataException: Cannot determine value type from string 'zhangsa'
; Cannot determine value type from string 'zhangsa'; nested exception is java.sql.SQLDataException: Cannot determine value type from string 'zhangsa'

note: when using @ builder annotation, a full parameter structure will be generated, resulting in the disappearance of no parameter structure

terms of settlement

    we can directly remove @ builder annotation, and there will be no problem for mybatis to query the database. We can generate parametric and nonparametric constructs in entity classes (you can add them manually or add annotations @ allargsconstructor , @ noargsconstructor )

    if it is still abnormal, you should check whether your entity class and database type mapping do not correspond

    Hold fireworks to seek life, poetic to seek love