Tag Archives: database

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

[Solved] SQL Error: Method queryTotal execution error of sql

In a connection query, there is no problem with the query in the MySQL query tool. It is pasted into the mapper.xml file in the project, but the runtime reports mybatisplusexception: error: method querytotal execution error of SQL:

 SELECT
        ANY_VALUE(e.id)  AS "id",
        ANY_VALUE(e.project_no) AS "projectNo",
        ANY_VALUE(sampleIn.sample_id)  AS "fieldNumber",
        ANY_VALUE(e.subject_no) AS "laboratoryNumber",
        ANY_VALUE(e.type) AS "type",
        ANY_VALUE(d.sampling_location) AS "location",
        ANY_VALUE(sampleIn.in_quantity)   AS "inquatity",
        ANY_VALUE(sampleIn.create_date)  AS "createDate",
        ANY_VALUE(sys_user.name)  AS "createUser",          
        ANY_VALUE(s. project_no)  AS "projectNoName",
        ANY_VALUE(s.subject_name)   AS "subjectName",
        ANY_VALUE(sd.name) AS "saveCondition",
        ANY_VALUE(sa.location) AS "location",
        ANY_VALUE(DATE_FORMAT(sa.shelf_life,'%Y-%m-%d'))AS"shelfLife"
        FROM labcode e
        LEFT JOIN labprojects s ON e.project_no = s.id
        LEFT JOIN labprojectplan n ON s.id = n.project_no        
        LEFT JOIN labprojectplan_field d ON n.id = d. lab_project_plan_id  AND e.serial_number = d.serial_number AND e.letter_code =d.letter_code    
        LEFT JOIN labsubjectsample sa ON e.id =sa.laboratory_number
        LEFT JOIN laboratorysamplein sampleIn ON sampleIn.code_id = e.id
        LEFT JOIN sys_user ON sampleIn.create_user=sys_user.user_id
        LEFT JOIN sys_dict sd ON sd.code = sa.save_condition
        WHERE 1 = 1
        AND s.is_delete = 0
        AND e.is_delete=0
        AND e.subject_no LIKE '%B'
        AND e.type=3
       
        GROUP BY e.id     
        ORDER BY ANY_VALUE(sampleIn.create_date) DESC

After going online to search, it was confirmed that it was the problem of where conditions, so they were eliminated one by one, and finally locked on several is_delete fields, which are of char type in the database. The database query tool supports direct use of 0 and 1 to query, and MyBatis needs to contact the database Keep consistent in the middle, and finally, change the where part to

WHERE 1 = 1
        AND s.is_delete = '0'
        AND e.is_delete='0'
        AND e.subject_no LIKE '%B'
        AND e.type='3'

Problem-solving

This exception is basically the problem of where conditions, and type mismatch is only one of them. Other problems include condition null value, keyword conflict with framework and so on. As long as you are careful when writing code, think more about avoiding exceptions, be patient when problems occur, check them one by one, and be good at summarizing after problems are solved, you can accumulate experience and grow gradually on the way of writing code.

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] Mac Install mongodb error: NonExistentPath: Data directory /data/db not found.

Error Messages:

{“t”:{“$date”:“2021-11-10T08:18:57.122+08:00”},“s”:“E”, “c”:“CONTROL”, “id”:20557, “ctx”:“initandlisten”,“msg”:“DBException in initAndListen, terminating”,“attr”:{“error”:“NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the –dbpath command line option, or (2) by adding the ‘storage.dbPath’ option in the configuration file.”}}
NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file.
This error means: The /data/db directory is not found. Let us use –dbpath to specify the directory to start or add storage.dbPath to specify the directory

Use --dbpath to Startup

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.

How to Solve MYSQL into outfile Error13

Error 13 is always reported when writing files. There is no problem viewing directory permissions. Finally, find the following solutions

Write files under Linxu
If you want to use the read and write functions, you must meet the following requirements

The current user is the root user
secure_file_priv is empty, or the folder to be written is just a specific folder of secure_file_priv
The folder where the shell is written must have 777 permissions, otherwise the writing will fail
File size, must be less than max_allowd_packet to
meet the above requirements in order to be written normally

Edit the file/etc/my.cof

Add
under [mysqld]

secure_file_priv =/var/www/html

MySQL view

and then

chmod 777 /var/www/html

Finally, restart the database

[Solved] Pre requisite check “checksystemcommandavailable” failed

[oracle@db1 ~]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/11.2.0/db_1  -local /soft/22646198/22502456
Oracle Interim patch installer version 11.2.0.3.29
Copyright (c) 2021, Oracle Corporation. all rights reserved.


Oracle home directory: /u01/app/oracle/product/11.2.0/db_1
Main product list: /u01/app/oraInventory
    From: /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version: 11.2.0.3.29
OUI version: 11.2.0.4.0
Log file location:/u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2021-11-05_08-58-35AM_1.log

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
UtilSession Failed: 
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Prerequisite check "CheckSystemCommandAvailable" failed.
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2021-11-05_08-58-35AM_1.log

OPatch failed with error code 73

Installation package:

yum install -y psmisc

Problem solving

[Solved] RHEL 7 installs Oracle RAC 11.2.0.4, executes root.sh error ohasd: failed to start

RHEL 7 installs Oracle RAC 11.2.0.4, executes root.sh and reports an error ohasd failed to start

Error reporting reason:

Because RHEL 7 uses SYSTEMd instead of initd to run and restart processes, while root.sh runs ohad processes through traditional initd.

Solution:
in RHEL 7, ohasd needs to be set as a service before running the script root.sh
the steps are as follows:

1. Create service file as root user
[root@rac1 ~]# touch /usr/lib/systemd/system/ohas.service
[root@rac1 ~]# chmod 777 /usr/lib/systemd/system/ohas.service
2. Add the following to the newly created ohas.service file
[root@rac1 init.d]# cat /usr/lib/systemd/system/ohas.service
[Unit]
Description=Oracle High Availability Services
After=syslog.target

[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always

[Install]
WantedBy=multi-user.target

3. Run the following command as root user
systemctl daemon-reload
systemctl enable ohas.service
systemctl start ohas.service
4. View running status
[root@rac1 init.d]# systemctl status ohas.service

Run root.sh after the service is up
if the ohad failed to start error is still reported, it may be that ohas.service does not start immediately after init.ohad is created by the root.sh script. Refer to the following for solutions:

When running root.sh, refresh/etc/init. D until the init.ohasd file appears. Start ohas.service manually immediately. The service command is systemctl start ohas.service

Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Migration checksum mismatch for m

Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Migration checksum mismatch for migration version 700013

When spring boot integrates flyway for database version management, the startup service reports an error org.flywaydb.core.api.flywayexception: validate failed: detected failed migration to version 1.1 (fixusername)

reason:

Because I modified SQL in the original version, this error is mainly due to flyway_ schema_ The recorded data in history affects the startup and needs to be checked

Solution 1:

If you don’t want to recreate a version,
you need to find the relevant table in the database, delete the data related to this version, modify and restore the fields related to this version, and then reload it

Solution 2

Create a new version, write the relevant data changes to the version, and restart the project

[Solved] Odoo Cannot log in error after the Database is Recovered

Many odoo users have encountered the problem that the backed up database cannot be restored

You can self-check in the following ways

1. Is the odoo version correct? Different versions of odoo cannot be restored directly, for example, odoo13 cannot be restored directly to odoo15

2. Whether the database version is correct, postgres may have problems when it is backward compatible. It is recommended to migrate to the same version.

3. Whether the code is migrated correctly, inconsistent codes on both sides will also cause an error, which is common in the conf file without specifying the code location.

If you confirm that the above content is correct, you can try the following methods

1. Add -d database name -i base when starting odoo through the command line, this method is to select the database to force the update of the base module; because all odoo modules are dependent on this, the mandatory update will be all the modules installed in the database after the base Will be upgraded.

2. Enter postgres, enter the following command

su postgres; # Switch postgres users
psql; # Enter the postgres command line
\c; database name # specify database instance
DELETE FROM ir_attachment WHERE url LIKE '/web/content/%'; # Delete the front-end files cached in the data table

Generally, most problems can be solved through the above two steps.