Tag Archives: linux

[Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)

MYSQL Startup error: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (111)

[root@iZ2zei01n7f2wrecqn5249Z ~]# sudo service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysqladmin -u root password '123456'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@iZ2zei01n7f2wrecqn5249Z ~]# sudo mysqladmin -u root password '123456'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@iZ2zei01n7f2wrecqn5249Z ~]# lsof -i:3306
-bash: lsof: command not found
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -uroot -h 127.0.0.1 -p
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[root@iZ2zei01n7f2wrecqn5249Z ~]# mysql -uroot -h 127.0.0.1 -p
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
[root@iZ2zei01n7f2wrecqn5249Z ~]# netstat -ntlp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      950/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      969/master          
tcp6       0      0 ::1:25                  :::*                    LISTEN      969/master          
[root@iZ2zei01n7f2wrecqn5249Z ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
[root@iZ2zei01n7f2wrecqn5249Z ~]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
● mysqld.service - MySQL Community Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2021-11-01 19:27:48 CST; 14s ago
  Process: 1724 ExecStartPost=/usr/bin/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 1664 ExecStartPre=/usr/bin/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 1723 (mysqld_safe)
   CGroup: /system.slice/mysqld.service
           ├─1723 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─1890 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/...

Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Support MySQL by buying support/licenses at http://shop.mysql.com
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Note: new default config file not created.
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: Please make sure your config file is current
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: WARNING: Default config file /etc/my.cnf exists on the system
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: This file will be read by default by the MySQL server
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: If you do not want to use this, either remove it, or use the
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysql-systemd-start[1664]: --defaults-file argument to mysqld_safe when starting the server
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysqld_safe[1723]: 211101 19:27:47 mysqld_safe Logging to '/var/log/mysqld.log'.
Nov 01 19:27:47 iZ2zei01n7f2wrecqn5249Z mysqld_safe[1723]: 211101 19:27:47 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Nov 01 19:27:48 iZ2zei01n7f2wrecqn5249Z systemd[1]: Started MySQL Community Server.

Start it.

service mysqld start

Recheck status

service mysqld status

Just as shown above
set the password

mysqladmin -u root password '123456'

Sign in

mysql -u root -p

[Solved] Linux Error: tar: Error Is Not Recoverable: Exiting Now

Under the Linux operating system, download the xx.tar.gz file and execute tar -zxvf xx.tar.gz. The following errors occur during execution:

xxx.tar.gz: EOF tar with exception in archive file: error is not recoverable: exiting now

There are two solutions.

Solution 1: remove the Z in the decompression parameters and execute the command as tar – xvf xx.tar.gz.

The reason for this scheme is that the downloaded file is not “filtered and archived through gzip”, so adding the parameter Z cannot decompress normally but generally, this problem does not occur when downloading from the official website. Be sure to download the full version from the official website.

If the scheme still fails to decompress normally, try the second scheme.

Solution 2: re download or upload compressed files

this scheme is aimed at downloading compressed files that are not complete, that is, they are not downloaded normally. You can download it again in another way. For example, after downloading through WGet, the above problems occur during execution. You can try to download it directly on other machines, upload it to the target server, and then execute the above decompression command.

Win10 Start Linux error: Error: 0x800701bc WSL 2 [How to Solve]

Error: 0x800701bc WSL 2

Manual installation of wsl

Step 1 - Enable the Windows subsystem for Linux
Step 2 - Check the requirements to run WSL 2
Step 3 - Enable the virtual machine feature
Step 4 - Download the Linux kernel update package
Step 5 - Set WSL 2 as the default version
Step 6 - Install the selected Linux distribution

SVN Update Error Please execute the ‘Cleanup‘ command [How to Solve]

Question

SVN Update Error: Please execute the ‘Cleanup’ command

Detailed description
when using SVN to update files, you will encounter failure (maybe because the last pull was forcibly interrupted). You will be prompted to need cleanup, but when you clean up, you will be prompted that the folder has been locked. At this time, you go to release lock, but still fail. You will be prompted to please execute the ‘cleanup’ command. (TMD is really difficult to use)

Solution:
obviously, this cannot be operated because the SVN file is locked and needs to be released, but manual release does not work, so you need to enter the SVN root directory where the locked folder is located, and then set the hidden files to be visible find the .SVN folder, and link wc.db with database management tools such as Navicat, DataGrid and other ides. This is a SQLite database. Find WC_Lock table

Delete locked records and submit updates to the database
it’s OK to update the code or file again

[Solved] error: ‘QStringLiteral’ was not declared in this scope

The following problem occurs with QT compilation:

error: ‘QStringLiteral’ was not declared in this scope
resmodel->setHorizontalHeaderLabels(QStringList()<<QStringLiteral(Name)<<QStringLiteral(Size));
^
QMetaObject::Connection connRet = QObject::connect(naManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
error: ‘connRet’ was not declared in this scope
Q_ASSERT(connRet);
^
/usr/include/qt4/QtCore/qglobal.h:1940:32: note: in definition of macro ‘Q_ASSERT’
define Q_ASSERT(cond) ((!(cond)) ?qt_assert(#cond,FILE,LINE) : qt_noop())
error: ‘class QComboBox’ has no member named ‘setCurrentText’; did you mean ‘setCurrentIndex’?
CombBox->setCurrentText(curX);

There is a situation that is caused by using QT4 to compile code written in QT5 environment, some operating systems have both QT4, QT5, just switch to QT5 is fine
QT Creator “Tools” —- “Options” —- “build&run” – “Build Kit ( kit)”-“qt version” select QT5 on it

[Solved] Jetson Nano catkin_make Error: internal compiler error

When Jetson Nano compiles with catkin_make, if the default is 4 threads (catkin_make -j4), internal compiler error is prone to occur. At this time, you can modify ~/.bashrc to change the number of threads compiled by the system to limit the maximum thread. Thus it compiles smoothly. Proceed as follows:
1. Open terminal

vim ~/.bashrc

2. Add the following command, n is the number of threads you want to set, for example, it is better to set it to 2 or less for Nano:

export ROS_PARALLEL_JOBS=-jn  # Nano n=2

3. Source it to take effect:

source ~/.bashrc

OK, you can experiment happily~

Message log output sbridge: Handling MCE memory error error

/The var/log/message system log is always output, causing the/partition disk to be full

sbridge: HANDLING MCE MEMORY ERROR
kernel: CPU 8: Machine Check Exception: o Bank 5: cc00020000010090
kernel: TSC O ADDR 2068ce8080 MISC 40109086 PROCESSOR O: 206d6 TIME 1634693540 SOCKET 1 APIC 20

resolvent:

 rmmod -v sb_edac

error: XML error: target ‘vdb‘ duplicated for disk sources ‘aaa.img‘ and ‘bbb.img‘

On a Sunday morning when you want to learn, try adding a hard disk to the KVM virtual machine with the command line.
create a disk
#qemu-img create – F qcow2/home/KVM FS/sy-b80915disk1.qcow2 10g

Bind disk to domain: sy-b80915
#virsh attach disk sy-b80915/home/KVM FS/sy-b80915disk1.qcow2 VDB — live — config

Later, I tried to unbind the VDA of the main disk. As a result, I accidentally unbind the VDA of the main disk
#virsh detach disk sy-b80915 VDA — live — config

But I unbound VDB, namely sy-b80915disk1.qcow2
#virsh detach disk sy-b80915 VDB — live — config

The virtual machine can still be restarted and used normally later, but I think the name of sy-b80915disk1.qcow2 is not good. Delete and recreate sy-b80915vdb.qcow2
#rm – RF/home/KVM/sy-b80915disk1.qcow2
#qemu-img create – F qcow2/home/KVM FS/sy-b80915vdb.qcow2 10g

Then bind
#virsh attach disk sy-b80915/home/KVM FS/sy-b80915vdb.qcow2 VDB — live — config
the results are as follows:
error: XML error: target ‘VDB’ duplicated for disk sources’ sy-b80915disk1. Img ‘and’ sy-b80915vdb. Img ‘
the big idea is to bind repeatedly, but it has been unbound before.

The only exception is that the main disk VDA is unbound accidentally, but the system can still run. So I checked the XML file. Compared with other virtual machines, I found that the XML file of SY – b80915 lacks the main disk VDA. When unbinding the VDA, the XML file is changed. So add VDA to the XML file again
execute the following command to edit the XML file:
#virsh edit sy-b80915
repair the XML definition of VDA, as shown in Figure 1:

Figure 1

Then bind sy-b80915vdb.qcow2 again. Success
#virsh attach-disk sy-B80915 /home/kvm-fs/sy-B80915vdb.qcow2 vdb –live –config

Error response from daemon: OCI runtime create failed: container_linux.go:380

Article catalog

The reasons for error reporting are as follows: error reporting solution: delete the new kernel

Self built multi GPU servers can refer to https://blog.csdn.net/landian0531/article/details/120242839

Error reporting reason

The unexpected power failure caused the Ubuntu server to restart, and the container in docker could not be started through the docker PS - AQ | xargs - I {} docker start {} command

Errors are reported as follows:

gpu@gpu-workstation:~$ docker ps -aq | xargs -I {} docker start {}
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #1:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: nvml error: driver not loaded: unknown
Error: failed to start containers: 485f0e25b37c

Error reporting solution: delete the new kernel

View the existing system kernel dpkg -- get selections | grep Linux

gpu@gpu-workstation:~$ dpkg --get-selections | grep linux
binutils-x86-64-linux-gnu                       install
console-setup-linux                             install
libnvpair1linux                                 install
libselinux1:amd64                               install
libuutil1linux                                  install
libzfs2linux                                    install
libzpool2linux                                  install
linux-base                                      install
linux-firmware                                  install
linux-generic                                   install
linux-headers-5.4.0-88                          install
linux-headers-5.4.0-88-generic                  hold
linux-headers-5.4.0-89                          install
linux-headers-5.4.0-89-generic                  install
linux-headers-generic                           install
linux-image-5.4.0-88-generic                    hold
linux-image-5.4.0-89-generic                    install
linux-image-generic                             install
linux-libc-dev:amd64                            install
linux-modules-5.4.0-88-generic                  hold
linux-modules-5.4.0-89-generic                  install
linux-modules-extra-5.4.0-88-generic            hold
linux-modules-extra-5.4.0-89-generic            install
util-linux                                      install
zfsutils-linux                                  install

It is found that 5.4.0-89 is automatically installed in the system. Delete the kernel through the sudo apt get purge linux-image-5.4.0-89-generic command
there is a prompt in the middle and select Cancel (Note: deleting the kernel is risky and needs your own consideration.)

After deletion, restart the server

gpu@gpu-workstation:~$ sudo apt-get purge linux-image-5.4.0-89-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool libdbus-glib-1-2 libevdev2 libimobiledevice6 libplist3 libupower-glib3 libusbmuxd6 linux-headers-generic thermald upower usbmuxd
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-unsigned-5.4.0-89-generic
Suggested packages:
  fdutils linux-doc | linux-source-5.4.0 linux-tools
The following packages will be REMOVED:
  linux-generic* linux-image-5.4.0-89-generic* linux-image-generic* linux-modules-extra-5.4.0-89-generic*
The following NEW packages will be installed:
  linux-image-unsigned-5.4.0-89-generic
0 upgraded, 1 newly installed, 4 to remove and 39 not upgraded.
Need to get 9,011 kB of archives.
After this operation, 202 MB disk space will be freed.
Do you want to continue?[Y/n] y
Get:1 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 linux-image-unsigned-5.4.0-89-generic amd64 5.4.0-89.100 [9,011 kB]
Fetched 9,011 kB in 4s (2,522 kB/s)
(Reading database ... 113040 files and directories currently installed.)
Removing linux-generic (5.4.0.89.93) ...
Removing linux-image-generic (5.4.0.89.93) ...
Removing linux-modules-extra-5.4.0-89-generic (5.4.0-89.100) ...
Removing linux-image-5.4.0-89-generic (5.4.0-89.100) ...
W: Removing the running kernel
I: /boot/vmlinuz is now a symlink to vmlinuz-5.4.0-88-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-88-generic
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-89-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Adding boot menu entry for UEFI Firmware Settings
done
Selecting previously unselected package linux-image-unsigned-5.4.0-89-generic.
(Reading database ... 107660 files and directories currently installed.)
Preparing to unpack .../linux-image-unsigned-5.4.0-89-generic_5.4.0-89.100_amd64.deb ...
Unpacking linux-image-unsigned-5.4.0-89-generic (5.4.0-89.100) ...
Setting up linux-image-unsigned-5.4.0-89-generic (5.4.0-89.100) ...
I: /boot/vmlinuz is now a symlink to vmlinuz-5.4.0-89-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-89-generic
(Reading database ... 107663 files and directories currently installed.)
Purging configuration files for linux-modules-extra-5.4.0-89-generic (5.4.0-89.100) ...
Purging configuration files for linux-image-5.4.0-89-generic (5.4.0-89.100) ...
I: /boot/vmlinuz is now a symlink to vmlinuz-5.4.0-88-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-88-generic
/var/lib/dpkg/info/linux-image-5.4.0-89-generic.postrm ... removing pending trigger
rmdir: failed to remove '/lib/modules/5.4.0-89-generic': Directory not empty
Processing triggers for linux-image-unsigned-5.4.0-89-generic (5.4.0-89.100) ...
gpu@gpu-workstation:~$

PHP large file upload error 413: request entity too large [How to Solve]

1. Nginx configuration modification

1. Modify the Nginx.conf (/ etc/Nginx/Nginx.conf) configuration file, and add or modify the following configuration in http{}:

client_max_body_size 20m; 

2. Restart nginx

systemctl restart nginx

2. PHP configuration modification

Find the location of the php.ini file:

Method 1

Use the command whereis php; to view the php related directories, if you can't find the ini file in the listed directories, you can refer to method 2.

Method 2

php --info > a.log;
vim a.log, To view the output, you can directly search for php.ini and you will see the directory where the file is located. As the following screenshot.

1. Modify the php.ini (/etc/PHP.ini) configuration file, find the following configuration and modify it:

post_max_size = 20M  
upload_max_filesize = 20M  

2. Restart PHP FPM

systemctl restart php-fpm

“2003” error reported by sqlyog for Linux remote connection solution

Just now xsell tried to connect to the database, but it couldn’t do anything. The error is reported: 2003, as shown in the following figure:

 

In xshell   ①   After closing the Linux Firewall   ② Start MySQL service   ③   After logging in with root, you need to authorize root, as shown in the figure below.

 

  Then it succeeded!

 

How to Solev QT compilation error “cannot find – LGL”

Cause: QT cannot find the dynamic link library of OpenGL. QT usually looks for dynamic link libraries in/usr/lib directory, but some Linux distributions will place OpenGL dynamic link libraries in other directories. For example, Ubuntu will be placed in/usr/lib/i386 Linux GNU/Mesa/. There are two solutions:

Method 1: directly copy the OpenGL dynamic link library file in/usr/lib/i386 Linux GNU/Mesa/directory to/usr/lib.

Note: the built-in OpenGL library in Linux will have the version number at the end, such as LIBGL.So.1, LIBGL.So.1.2. However, the file required by QT when linking does not have a version number, that is, libgl.so. Method 2: create a soft link for the OpenGL dynamic link library file in/usr/lib/i386 Linux GNU/Mesa/directory

ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so