Beginner Database



  • I have several kids who are now quite strong with Python. Ideally, I’d like to get them using Python with an SQL database.

    I found the Beginner Database sushi cards and installed xampp. It’s got MariaDB inside and not mysql. I figured that might not matter. However, I am getting an
    ERROR 1044 (42000): Access denied for user ’ '@‘localhost’ to database ‘CoderDojo’

    I’m on Mac. Has anyone done these card recently who knows what needs to be done? I think these would be of interest to my dojo kids this week if I can get them working.

    Also - does anyone have good materials to get kids going between Python and MySQL or another relational database? 0_1521675812289_Screen Shot 2018-03-21 at 7.37.29 PM.png


  • CoderDojo Foundation

    I didn’t have a look at this sushi (do you have a link to it? :)) but the error you encounter means you don’t have the privileges on the database (databases have their own user management).
    What command did you use to connect to it? Try logging-in as root (generally “-U root” with the CLI tool) when connecting to the DB.



  • The sushi cards are here:
    http://kata.coderdojo.com/images/6/69/Beginner-Databases.pdf

    Sushi cards use double clicking to start mysql.exe. I’m on a Mac, and get the error shown in the first question.

    I’ve switched to using the phpadmin ui for now, and moving along through the cards. The UI does a nice job showing the SQL so the kids may be able to figure out how to do the cards using the UI. Foreign key creation was the only thing that wasn’t reasonably straightforward so far.

    My bigger problem will then be how to get a python program connected to the database and the right permissions for the program to make the commands.


  • CoderDojo Foundation

    It seems the most recent/likely connector if you want to use row query without using an ORM would be mysqlclient (pip install mysqlclient, https://mysqlclient.readthedocs.io/user_guide.html#introduction)
    I haven’t used XAMPP for years (and I’m not aware of any Mac related behavior to be fair), but that should be a start :)
    Hope it helps a bit;
    @Philip-Harney any ideas?



  • @Guillaume-Feliciano
    Yes, I looked at that a little - but couldn’t figure it on Mac. I’ve been debating if I just put everything onto my Raspberry Pi and try it there. That looks easier.

    In the mean time, I did find a good tutorial to access mysql from PHP. So, I have php->mysql working. We’ll find out tomorrow whether the kids want to try.



  • @Ruth-Willenborg101 Hi Ruth! Question - is your goal to connect python to a database for app development? Or to use python for data science?

    I have been thinking about doing the latter. My students are on Chromebooks so I have to look at cloud solutions, and am thinking about using https://datascience.ibm.com/



  • @Pete-Gegen Hi Pete! It’s for app development. I did have several dojo kids do some of the machine learning with Scratch and Watson projects (machinelearningforkids.co.uk). They didn’t hold their interest for more than one session. I’ve got several kids getting pretty advanced - and writing programs where database makes sense.


Log in to reply
 

Looks like your connection to CoderDojo Forum was lost, please wait while we try to reconnect.