Tag Archives: Database development

[Solved] Navicat premium 15 Registration Machine Error: Error on Generate Activation Code…

Navicat premium 15 Registration Machine Error: Error on Generate Activation Code…

How to Solve:

① There is only one chance to patch. If it fails, uninstall, delete the registry, and then reinstall

Win + R, enter regedit and find the computer \HKEY_CURRENT_USER\Software\PremiumSoft, delete all Navicat folders in premiumsoft, and then start again (no all pattern found! Use this to solve the error)

② Error on Generate Activation Code

The network needs to be disconnected during the operation. It is recommended to install the segment at the beginning. If it fails at one time, you need to uninstall, delete the registry, install again, and then patch + manual activation

Django CSV file Error: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb5 in position 0: invalid start

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb5 in position 0: invalid start

This csv file I opened in jupyter using pd.read_csv open no problem

But after I cleaned the data and saved it as a new csv, I couldn’t open it and got an error

Solution: in the views.py direct cleaning work, the data will be stored in order into a list, using a loop to iterate through the database, the following is the code (less efficient after all is iterative. Welcome to share a better way)

df = pd.read_csv(r"xxxxx\xxx.csv", encoding='utf-8')
... # datas clean up
ls = []
for index, row in df.iterrows():
     res = []
     for i in df:
         res.append(row[i])
            ls.append(res)
for i in range(len(ls)):
    try:
        XXX.objects.create(title=ls[i][0], rating=ls[i][1])
    except Exception as e:
        print(e)
return HttpResponse('Datas save successfully')

[Solved] Job for mysqld.service failed because the control process exited with error code.

Install mysql8 in centos8 environment by using yum. The following error messages are reported:

Job for mysqld.service failed because the control process exited with error code.

See "systemctl status mysqld.service" and "journalctl -xe" for details.

 

Because VIM/etc/my.cnf file Is configured before installation, specifying the directory /var/log/mysqld.log

The actual log directory is /var/log/MySQL/mysqld.log

After modifying the directory, restart OK