Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Saturday, 16 May 2020

Resolution DB password issue

First, connect in sudo mysql

sudo mysql -u root

Check list of DB users  present 

SELECT User,Host FROM mysql.user;
+------------------+-----------+
| User             | Host      |
+------------------+-----------+
| admin            | localhost |
| debian-sys-maint | localhost |
| magento_user     | localhost |
| mysql.sys        | localhost |
| root             | localhost |

Delete current root@localhost account

mysql> DROP USER 'root'@'localhost';
Query OK, 0 rows affected (0,00 sec)
Recreate your user

mysql>uninstall plugin validate_password;

mysql> CREATE USER 'root'@'%' IDENTIFIED BY '';
Query OK, 0 rows affected (0,00 sec)
Give permissions to your user (don't forget to flush privileges)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0,00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,01 sec)
Exit MySQL and try to reconnect without sudo.

CREATE USER 'db_user'@'%' IDENTIFIED BY '';



How to import database via command line


  • Open the MySQL command line
  • Type the path of your mysql bin directory and press Enter
  • Paste your SQL file inside the bin folder of mysql server.
  • Create a database in MySQL.
  • Use that particular database where you want to import the SQL file.
  • Type source databasefilename.sql and Enter
  • Your SQL file upload successfully.


db - db_mapper
u - db_user
p - password123

CREATE DATABASE db_mapper;
use db_mapper;
CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'password123';
GRANT ALL PRIVILEGES ON db_mapper.* TO 'db_user'@'localhost';


CREATE USER 'db_user'@'localhost' IDENTIFIED BY 'password123';
GRANT ALL PRIVILEGES ON db_mapper.* TO 'wordpress_user'@'localhost';

Pre- requisite for Mysql-client using python

sudo apt-get install libmysqlclient-dev
sudo apt-get install python3-pymysql
sudo apt-get install python3.6-dev

Wednesday, 13 March 2019

Cannot open include file: 'leptonica/allheaders.h': No such file or directory

tesseract_ocr.cpp(626): fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

"mspdb100.dll couldn't be found by cl.exe "
 

For all above error we should make sure to follow following steps based on your OS version as mentioned in given link 

Monday, 11 March 2019

pip is not recognized as an internal or external command

If you are getting following error while running pip command in 'cmd'

pip is not recognized as an internal or external command 

Change installation path of Python from default location,
C:\User\username\AppData\Local\Programs\Python\Python36

to

C:\Python36

using Custom installation of Python.


Post that make sure Adding Python and PythonPath to the Windows environment:


  1. Open Explorer.
  2. Right-click 'Computer' in the Navigation Tree Panel on the left.
  3. Select 'Properties' at the bottom of the Context Menu.
  4. Select 'Advanced system settings'
  5. Click 'Environment Variables...' in the Advanced Tab

       Under 'System Variables':

       Add
      PY_HOME
     "C:\Python3.6\"   

      PYTHONPATH
      %PY_HOME%\Lib;%PY_HOME%\DLLs;%PY_HOME%\Lib\lib-tk;C:\another-library

       Append
       PATH      %PY_HOME%;%PY_HOME%\Scripts





In case if it still doesn't work then you can prefix 'pip' with following commands:

py -m pip install


Videos based solutions

City / Traffic Surveillance Target Sectors Government Sectors Traffic Surveillance Highway and State Road Surveillance Defense Ai...