After a thousand million years, I was finally able to put data into a MYSQL table.
I first tried to follow this tutorial to learn how to use MYSQL with python.
However, I quickly got stuck at the step of:
$ mysql -u root -p
This brought me the first error message:
- "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)""
I followed this down a rabbit hole of other commands and error messages, some of which are listed below.
$ /etc/init.d/mysql
- "Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start
/etc/init.d/mysql: 54: /etc/init.d/mysql: initctl: not found
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
/etc/init.d/mysql: 82: /etc/init.d/mysql: start: not found/usr/bin/service: 123: exec: start: not found"
$ service mysql start
- "start : Unknown job: mysql"
Many hours of research brought me to this page after I searched for "initctl not found crouton": https://github.com/dnschneid/crouton/wiki/Running-servers-in-croutonO
Thr problem apparently transpired because I was running Crouton on a chromebook. Turns out the MYSQL server doesn't start automatically when the chroot boots up. Never would have guessed that.
Once I applied the solution listed on the github site, the MYQL server started running when I start my chroot. Fingers crossed that it will stay like that!
I went back and finished the python tutorial mentioned above. I found it to be really useful for getting me started with mysqldb in python.
I finally got to read in my csv of data, and put it into a mysql table.
I'm very happy that I don't have to deal directly with the csv anymore. I'm hoping the MYSQL database will be easier to handle.
Next time: labeling data.
No comments:
Post a Comment