Category Archives: MySQL

[Solved] Red hat 7.9 install DM8 of Damon database and starting graphical error with xmanager enterprise 5

Red hat 7.9 install DM8 of Damon database and starting graphical error with xmanager enterprise 5

Error Messages:

[dmdba@dmdb01 dmsetup]$ ./DMInstall.bin 
Extract install files......... 
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-pi-gtk-3659 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/swtlib-64/libswt-pi-gtk-3659.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    Can't load library: /tmp/swtlib-64/libswt-pi-gtk.so
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:267)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
    at org.eclipse.swt.widgets.Widget.isValidSubclass(Widget.java:988)
    at org.eclipse.swt.widgets.Decorations.checkSubclass(Decorations.java:164)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:258)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:253)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:204)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:140)
    at com.dameng.common.gui.util.SWTUtility.canInitGUI(SWTUtility.java:380)
    at com.dameng.install.ui.MainApplication.run(MainApplication.java:80)
    at com.dameng.install.ui.MainApplication.main(MainApplication.java:436)
[dmdba@dmdb01 dmsetup]$

 

Solution:
This kind of error is graphics related with the missing rpm package error message, use find command to find the relevant rpm package also does not exist, you need to install additional.
Make sure the local yum source is properly configured or the network is kept open, enter the following command.
yum install gtk2 libXtst xorg-x11-fonts-Type1
[root@dmdb01 yum.repos.d]# yum install gtk2 libXtst xorg-x11-fonts-Type1
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package libXtst-1.2.3-1.el7.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package gtk2.x86_64 0:2.24.31-1.el7 will be installed
—> Package xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 will be installed
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Running transaction check
—> Package ttmkfdir.x86_64 0:3.0.9-42.el7 will be installed
—> Package xorg-x11-font-utils.x86_64 1:7.5-21.el7 will be installed
–> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-21.el7.x86_64
–> Running transaction check
—> Package libfontenc.x86_64 0:1.1.3-3.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================
Package                                 Arch                      Version                           Repository                      Size
==========================================================================================================================================
Installing:
gtk2                                    x86_64                    2.24.31-1.el7                     rhel-source                    3.4 M
xorg-x11-fonts-Type1                    noarch                    7.5-9.el7                         rhel-source                    521 k
Installing for dependencies:
libfontenc                              x86_64                    1.1.3-3.el7                       rhel-source                     31 k
ttmkfdir                                x86_64                    3.0.9-42.el7                      rhel-source                     48 k
xorg-x11-font-utils                     x86_64                    1:7.5-21.el7                      rhel-source                    104 k
Transaction Summary
==========================================================================================================================================
Install  2 Packages (+3 Dependent packages)
Total download size: 4.1 M
Installed size: 14 M
Is this ok [y/d/N]: y
Downloading packages:
——————————————————————————————————————————————
Total                                                                                                     120 MB/s | 4.1 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ttmkfdir-3.0.9-42.el7.x86_64                                                                                           1/5
Installing : libfontenc-1.1.3-3.el7.x86_64                                                                                          2/5
Installing : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                                                                                3/5
Installing : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                  4/5
Installing : gtk2-2.24.31-1.el7.x86_64                                                                                              5/5
Verifying  : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                  1/5
Verifying  : libfontenc-1.1.3-3.el7.x86_64                                                                                          2/5
Verifying  : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                                                                                3/5
Verifying  : gtk2-2.24.31-1.el7.x86_64                                                                                              4/5
Verifying  : ttmkfdir-3.0.9-42.el7.x86_64                                                                                           5/5
Installed:
gtk2.x86_64 0:2.24.31-1.el7                                   xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
Dependency Installed:
libfontenc.x86_64 0:1.1.3-3.el7            ttmkfdir.x86_64 0:3.0.9-42.el7            xorg-x11-font-utils.x86_64 1:7.5-21.el7
Complete!
[root@dmdb01 yum.repos.d]#
Start the installer again and it will display the graphical representation properly.

[Solved] Error 1044: Access denied for user ‘syz-remote‘@‘%‘ to database ‘webapp‘

Error 1044: Access denied for user ‘syz-remote’@‘%’ to database ‘webapp’

Cause: I was testing the code of golang connecting to the database. I finally reinstalled MySQL and set up remote login, but this problem still occurred.

My SYZ-remote account is specially created for remote login. Therefore, unlike the root user, it does not have the due permission. We need to set its permissions in MySQL .

View MySQL account permissions through this code

mysql> SELECT host,user,password_expired,Grant_priv,Super_priv FROM mysql.user;
+-----------+------------------+------------------+------------+------------+
| host      | user             | password_expired | Grant_priv | Super_priv |
+-----------+------------------+------------------+------------+------------+
| localhost | root             | N                | Y          | Y          |
| localhost | mysql.session    | N                | N          | Y          |
| localhost | mysql.sys        | N                | N          | N          |
| localhost | debian-sys-maint | N                | Y          | Y          |
| %         | syz-remote       | N                | N          | N          |
+-----------+------------------+------------------+------------+------------+
5 rows in set (0.00 sec)

You can see that the permission of Grant_priv and Super_priv in syz-remote is N

We gave him authority

update mysql.user set grant_priv = 'Y', Super_priv='Y' where user = 'syz-remote';

Refresh it again

flush privilegs;

[Solved] ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm

The error information is as follows:

ERROR: Command errored out with exit status 1:
     command: /home/hanqing/PycharmProjects/djangoProject/hz_venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-79c7p3i8/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-79c7p3i8/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-jhaimgx4
         cwd: /tmp/pip-install-79c7p3i8/mysqlclient/
    Complete output (12 lines):
    /bin/sh: 1: mysql_config: not found
    /bin/sh: 1: mariadb_config: not found
    /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-79c7p3i8/mysqlclient/setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-79c7p3i8/mysqlclient/setup_posix.py", line 65, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-79c7p3i8/mysqlclient/setup_posix.py", line 31, in mysql_config
        raise OSError("{} not found".format(_mysql_config_path))
    OSError: mysql_config not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

 

Solution:

sudo apt-get install libmysqlclient-dev
pip install mysqlclient

[Solved] MybatisPlus Error: Error querying database. Cause: java.lang.IndexOutOfBoundsException

Cause: java.lang.IndexOutOfBoundsException” error when testing after using mybatisplus to generate code changes.

Using mybatis-plus code generation tool `@AllArgsConstructor` is not checked `@NoArgsConstructor` lombok annotation; in the resultSet session, can not find the appropriate object generation method to generate an exception, here for the record to find.

[Solved] ERROR 1030 (HY000): Got error 28 from storage engine

Problem background

When logging into the database to view the table structure in Linux environment, an error is reported:

desc base_mirror;
ERROR 1030 (HY000): Got error 28 from storage engine

Most of the conclusions of Google search are the problem of insufficient disk space

View the temporary space directory of MySQL

mysql> show variables like '%dir%';
+-----------------------------------------+----------------------------+
| Variable_name                           | Value                      |
+-----------------------------------------+----------------------------+
| basedir                                 | /usr/                      |
| binlog_direct_non_transactional_updates | OFF                        |
| character_sets_dir                      | /usr/share/mysql/charsets/ |
| datadir                                 | /var/lib/mysql/            |
| ignore_db_dirs                          |                            |
| innodb_data_home_dir                    |                            |
| innodb_log_group_home_dir               | ./                         |
| innodb_max_dirty_pages_pct              | 75                         |
| innodb_max_dirty_pages_pct_lwm          | 0                          |
| innodb_tmpdir                           |                            |
| innodb_undo_directory                   | .                          |
| lc_messages_dir                         | /usr/share/mysql/          |
| plugin_dir                              | /usr/lib64/mysql/plugin/   |
| slave_load_tmpdir                       | /tmp                       |
| tmpdir                                  | /tmp                       |
+-----------------------------------------+----------------------------+
15 rows in set (0.00 sec)

View this machine as follows:

#df -TH
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs   17G  9.6G  7.2G  58% /dev
tmpfs          tmpfs      17G  4.1k   17G   1% /dev/shm
tmpfs          tmpfs      17G  1.5M   17G   1% /run
tmpfs          tmpfs      17G     0   17G   0% /sys/fs/cgroup
/dev/vda2      ext4       63G   63G   0G  100% /
/dev/vda1      ext4      1.1G  145M  809M  16% /boot
tmpfs          tmpfs     3.4G     0  3.4G   0% /run/user/0
overlay        overlay    63G   45G   15G  75% /home/docker/overlay/5a22b3cdbe381649e30044980fd09341ceb4460c98fd36055c4727c3c31f9f9b/merged
shm            tmpfs      68M     0   68M   0% /home/docker/containers/f61e00164f9f7d2077952af0a025670d7b88a7fb42c37c4e73d7e4c68ef3115e/shm

The overall space of the machine is still available, but the space of the root directory is insufficient, and the MySQL temporary space directory is under the root directory. You need to delete it to make space. After operation:

mysql> desc base_mirror;
+--------------------+--------------+------+-----+---------+----------------+
| Field              | Type         | Null | Key | Default | Extra          |
+--------------------+--------------+------+-----+---------+----------------+
| id                 | int(11)      | NO   | PRI | NULL    | auto_increment |
| mirror_name        | varchar(100) | NO   |     | NULL    |                |
| origin_mirror_name | varchar(100) | NO   |     | NULL    |                |
| mirror_tag         | varchar(100) | NO   |     | NULL    |                |
| cloud_version      | varchar(100) | NO   |     | NULL    |                |
| archi              | varchar(100) | NO   |     | NULL    |                |
| mirror_path        | varchar(200) | NO   |     | NULL    |                |
| os_version         | varchar(100) | NO   |     | NULL    |                |
| namespace          | varchar(100) | NO   |     | NULL    |                |
| description        | longtext     | NO   |     | NULL    |                |
| upgrade_log        | longtext     | YES  |     | NULL    |                |
| create_time        | datetime(6)  | NO   |     | NULL    |                |
| gitlab_path        | varchar(200) | NO   |     | NULL    |                |
| branch_name        | varchar(200) | NO   |     | NULL    |                |
| docker_file_path   | varchar(200) | NO   |     | NULL    |                |
| Dockerfile_info    | longtext     | YES  |     | NULL    |                |
| build_log          | longtext     | YES  |     | NULL    |                |
| commit_id          | varchar(100) | NO   |     | NULL    |                |
| user               | varchar(100) | YES  |     | NULL    |                |
| is_newest          | varchar(100) | NO   |     | NULL    |                |
| is_delete          | varchar(20)  | NO   |     | NULL    |                |
| is_free            | varchar(20)  | NO   |     | NULL    |                |
| can_upgrade        | int(11)      | NO   |     | NULL    |                |
| owner              | varchar(100) | NO   |     | NULL    |                |
| imageid            | varchar(64)  | NO   |     | NULL    |                |
| mirror_sha         | varchar(255) | NO   |     | NULL    |                |
| mirror_label       | varchar(25)  | NO   |     | NULL    |                |
| is_escrow          | int(11)      | NO   |     | NULL    |                |
| openapi_taskid     | int(11)      | YES  |     | NULL    |                |
| is_recommend       | int(11)      | NO   |     | NULL    |                |
+--------------------+--------------+------+-----+---------+----------------+
30 rows in set (0.00 sec)

Problem-solving.

[Solved] Mysql Build Error: [ERROR] Slave I/O for channel ‘‘: error connecting to master

Project scenario:

mysql5. 7 build dual master replication:
host a: 192.168.218.62:3306 production library
host B: 192.168.218.95:3307 create a new empty library
operating system: centos7

Problem description

tip: describe the problems encountered in the project here:
start slave on host B:
change master to master_ host=‘192.168.218.62’,master_ port=3306,master_ user=‘repl’,master_ password=‘*****’,master_ log_ file=‘mysql-bin. 000017’,master_ log_ pos=****;
start slave replication is normal;

Enable slave on host a:
change master to master_ host=‘192.168.218.95’,master_ port=3307,master_ user=‘repl’,master_ password=‘*****’,master_ log_ file=‘mysql-bin. 1234’,master_ log_ pos=****;
after start save, show slave status reports the following error:
error connecting to master‘ [email protected] : 3307 ‘- retry time: 60 retries: 6
check that there are no other meaningful logs under/var/log/messages

Cause analysis:

Troubleshooting route:
1 Log in to host B MySQL on host a: MySQL – U repl – p ‘*****’ – P 3307 – H 192.168.218.95 normal – eliminate account and password errors
2. Check the permission of the replication account on host B, show grants for repl @ ‘%’ and find that it has the permission of replication slave and replication client – eliminate the permission problem
I tried to create a new account, but it didn’t work to restart the service.
finally, it is found that SELinux is not related
check SELinux status:

 [root@localhost ~]# getenforce
Enforcing(means selinux does not close)

Solution:

Close SELinux:
I Temporary shutdown
enter the command setenforce = 0 (it will be invalid after restarting the machine)
check SELinux status:

[root@localhost ~]# getenforce
	Permissive(means close successfully)

II Permanently close
open the /etc/selinux/config file and modify SELINUX=DISABLED (the server needs to be restarted to take effect);

re-change master and then restart to copy successfully

[Solved] mysqldump: Got error: 1556: “You can‘t use locks with log tables.“ when using LOCK TABLES

Problem description

Recently, when backing up MySQL data, an error was found in dump database:

mysqldump: Got error: 1556: "You can't use locks with log tables." when using LOCK TABLES

Solution steps:

Checked because there are two table locks in the dump MySQL library.

Add --lock-tables =0 after mysqldump instruction.

Summary

Mysqldump backup will turn on the lock table by default – opt is turned on by default, which will affect the online business when backing up big data

To prevent this, we can use --skip-opt to cancel this default option in backup After adding this parameter, the above error report will not appear.

mysqldump  --skip-opt -h<host> -u<user> -p<password> -A  >> backup.sql    --Perform full backups

[Solved] Windows MYSQL Error: django.db.utils.OperationalError: (2026, ‘SSL connection error: unknown error number‘)

Error Messages:
PS D:\test\orchard_liang>python manage.py sqlmigrate app 0001
Traceback (most recent call last):
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
    self.connect()
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 234, in get_new_connection
    connection = Database.connect(**conn_params)
  File "D:\Python37\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
    return Connection(*args, **kwargs)
  File "D:\Python37\lib\site-packages\MySQLdb\connections.py", line 179, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2026, 'SSL connection error: unknown error number')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "D:\Python37\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "D:\Python37\lib\site-packages\django\core\management\__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\Python37\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "D:\Python37\lib\site-packages\django\core\management\commands\sqlmigrate.py", line 29, in execute
    return super().execute(*args, **options)
  File "D:\Python37\lib\site-packages\django\core\management\base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "D:\Python37\lib\site-packages\django\core\management\commands\sqlmigrate.py", line 37, in handle
    loader = MigrationLoader(connection, replace_migrations=False)
  File "D:\Python37\lib\site-packages\django\db\migrations\loader.py", line 53, in __init__
    self.build_graph()
  File "D:\Python37\lib\site-packages\django\db\migrations\loader.py", line 220, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "D:\Python37\lib\site-packages\django\db\migrations\recorder.py", line 77, in applied_migrations
    if self.has_table():
  File "D:\Python37\lib\site-packages\django\db\migrations\recorder.py", line 55, in has_table
    with self.connection.cursor() as cursor:
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 259, in cursor
    return self._cursor()
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 235, in _cursor
    self.ensure_connection()
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
    self.connect()
  File "D:\Python37\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 219, in ensure_connection
    self.connect()
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\base\base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "D:\Python37\lib\site-packages\django\utils\asyncio.py", line 33, in inner
    return func(*args, **kwargs)
  File "D:\Python37\lib\site-packages\django\db\backends\mysql\base.py", line 234, in get_new_connection
    connection = Database.connect(**conn_params)
  File "D:\Python37\lib\site-packages\MySQLdb\__init__.py", line 84, in Connect
    return Connection(*args, **kwargs)
  File "D:\Python37\lib\site-packages\MySQLdb\connections.py", line 179, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (2026, 'SSL connection error: unknown error number')

Reason: SSL of the higher versions of MySQL is turned on by default
solution: turn off SSL

Step 1: check the SSL startup first

Login mysql and then enter the commands below:
mysql> SHOW VARIABLES LIKE '%ssl%';

Step 2: Modify the configuration file my.ini

# PATH: C:\ProgramData\MySQL\MySQL Server 8.0
[mysqld]
skip_ssl  # ssl

Step 3: restart MySQL service

ctrl+shift+esc key to call up task manager -> services -> find mysql service -> right click and rerun

Step 4: re execute the command:

mysql> SHOW VARIABLES LIKE '%ssl%';


[Solved] MySQL Notifier Error Cannot Initialize Main Application

In response to this problem, you can search for MySQL Notifier in the C drive. My solution: Find MySQL Installer for Windows in the following path, click, follow the instructions, and reinstall. After the installation is successful, click the upward arrow in the lower right corner, and you should be able to see the third picture.