University of Houston–Clear Lake

 STEP ONE: GET CONNECTED TO APACHE SERVERDownload XAMPP () and follow all download proceduresOnce downloaded, click on XAMPP and you should see the following window. Click ‘Start’ on both Apache (to connect to our cross-platform server) and MySQL (to get connected to our database management system).Open a new browser and type in ‘localhost’ Once you press enter, click on the ‘phpMyAdmin’ on the top right cornerCongrats! You’re connected!STEP TWO: CREATE A USER ACCOUNT Click on “User Account”. You will be creating two types of accounts; one that can be connected locally and one that can be connected via your IP address. For the purpose of this homework, you will be creating both but only utilizing the one that can be accessed locally. Click on “Add user account”Create a user name for yourself under the “user name” field and create your own password. In this image, there is a “%” on the “host name” field. This is a wildcard which represents “zero or more” characters. This allows your user account to get connected to the IP address. Again, you wont need this for this homework.Scroll down a bit and choose your global privileges. Since phpMyAdmin serves as an administration tool for database managers, this field is typically used to grant different users with various degrees of privileges. In the purpose of this homework, however, you can just “check all” which grants you the ability to utilize all the methods available. Click “Go” on the bottom right corner.Congrats! Now you’ve created a new user that can be accessed via your IP address.Now we do it again but with a little change. This time, you change that “%” symbol to “localhost” and click on “local” which is on that drop-down window labeled “any host”. You can use the same username and password, if that helps you remember it a little better. STEP THREE: FILE PATHType in “env” in your computer search bar and you should see something like this:When you click on it, it should pop up the “System Properties” window. Clock on “Environment Variables...” on the bottom right sideYou should see “PATH” under System Variables. Double-click on this.An “Edit environment variable” table should pop out. Towards the bottom, you should see something along the lines of C:\xampp…..\bin . Click on this and press “OK”. Press ok on all the systems properties windows to close them.STEP FOUR: GETTING STARTED ON THE TERMINALIf you haven’t already downloaded the toyu (or whatever the homework file name is) file, you can do so by downloading to Notepad++ or , in my case, Sublime text. Any text editor should do. When you download and save to your own directory, change “.txt” to “.sql” so instead of it being filename.txt, it will be filename.sql . In your file manager, go to the directory/folder where you saved your new file. In the search bar on top where I’ve pointed to, type “cmd” and press enterOnce you press enter, a terminal window should pop up like so. As you can see, I have my homework saved as “createtoyu.sql” in a special directory I’ve created ahead of time called “hw2_dir”. By clicking cmd directly on the bar where we had our file, the terminal automatically pops up where we are in our relative path. Easy peasy!STEP FIVE: UTILIZING MARIA DBIn the terminal, type in sql -u username -p. Change “username” to the one you created earlier. It then prompts you to type in your password. For example, my username was s1 so I typed in sql -u s1 -p. It should look like the bottom once you’ve typed in your passwordGreat! Now we’ve accessed MariaDB,which is a fork of MySQL. To load your homework, type use toyu. This loads the toyu data that we need to work on.Congratulations! The hard part is over! Now for the fun part: we can now use SQL commands on our terminal to access our data. Here’s an example. I typed in select * from student . Check out my mistake: I forgot the semicolon ; . It gives you a little arrow in the new line to try your code again. I then typed select * form student; as shown by the blue arrowCONGRATULATIONS! You’ve made it to the end. Now to master SQL!Here are a couple of SQL and command line resources I recommend:My SQL cheat sheet: Command Line cheat sheet: If you’re on Linux: you’re on Mac: ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download