SMBUS and MySQL

Reviews and other little ventures that don't quite fit into the other forums
Post Reply
Daniel Wee
Site Admin
Posts: 2449
Joined: Wed 25 Feb 25 2009 8:00 pm

SMBUS and MySQL

Post by Daniel Wee »

Python support for I2C smbus and MySQL

pip install MySQL-python

apt-get install libmysqlclient-dev build-essential libi2c-dev i2c-tools python-dev libffi-dev
pip install cffi
pip install smbus-cffi

apt-get install python-mysqldb

apt-get install python-smbus
Daniel Wee
Site Admin
Posts: 2449
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: SMBUS and MySQL

Post by Daniel Wee »

For Ubuntu 18.04 you need a special password to log into the system to get things going:-

https://stackoverflow.com/questions/339 ... 5#50305285

Specifically, you need to:-

sudo cat /etc/mysql/debian.cnf

and then using the user and password provided:-

mysql -u debian-sys-maint -p

After entering the password, you will be in the console:-

select User, Host, plugin from mysql.user;
update user set plugin='mysql_native_password' where User='root';
flush privileges;
alter user 'root'@'localhost' identified by 'new-password';
flush privileges;
update user set Host='%' where User='root';
flush privileges;
exit

The restart the mysql server:-

sudo service mysql restart
Daniel Wee
Site Admin
Posts: 2449
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: SMBUS and MySQL

Post by Daniel Wee »

Default my.cnf

http://www.fromdual.com/mysql-configuration-file-sample

Recommended for cacti
Post Reply