mysql

MySql Function for Date Time Input Terminal Commands

MySql Function For Date Time Input Terminal Commands

For date time input use this function. NOW() Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Add A Column MySql Terminal Command

Add A Column MySql Terminal Command

If you’re working with a MySQL database, you may find that you need to add a new column to a table. Fortunately, adding a column to a MySQL table is a straightforward process that we will do using the MySQL terminal command. Here’s how: Open the MySQL terminal First, open the MySQL terminal and connect Read More

Insert A Record MySql Terminal Command

Insert A Record MySql Terminal Command

To insert a record use this command in terminal. Customize the values. INSERT INTO [table] ([column], [column]) VALUES (‘[value]’, [value]’); Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Create A New Table With Column MySql Terminal Command

Create A New Table With Column MySql Terminal Command

To create a new table with columns use this command. CREATE TABLE [table] ([column] VARCHAR(120), [another-column] DATETIME); Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

List All Indexes On A Table MySql Terminal

List All Indexes On A Table MySql Terminal

To see all indexes on a table enter this code. show index from [table]; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Show Table Structure MySql Terminal Commands

Show Table Structure MySql Terminal Commands

To show the table structure in terminal use this code. describe [table]; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Show Tables MySql Terminal Commands

Show Tables MySql Terminal Commands

If you want to see the tables in the database use this command. show tables; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Create A New Database Terminal Commands

Create A New Database Terminal Commands

If you want to create a new database in terminal enter the following command. create database [database]; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Determine What Database Is In Use MySql Terminal Commands

Determine What Database Is In Use MySql Terminal Commands

If you want to know what database that you are in you can use this terminal command. select database(); Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Select A Database Terminal Command

Select A Database Terminal Command

You can select a database to work with by entering the following command in terminal. use [database]; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Access a Database MySQL Terminal Command

Access a Database MySql Terminal Command

If you’re a developer working with databases, you’re probably familiar with MySQL – an open-source relational database management system. While there are many ways to access a MySQL database, one of the most straightforward methods is through the MySQL terminal command. To access a MySQL database through the terminal, follow these simple steps: Open your Read More

Show all databases in MySql Terminal Command

Show all databases in MySql Terminal Command

In order to show all databases in your terminal enter the following code. show databases; Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Access MySql Terminal Commands

Access MYSQL Terminal Commands

In order to access your the mysql part in your terminal you will enter something like this. Access monitor: mysql -u [username] -p; (will prompt for password) This will get you logged into the mysql part in your terminal. Complete Cheat Sheet https://gist.github.com/hofmannsven/9164408

Using Crypt to Encrypt Password in PHP

PHP Web Development

Sometimes we need to encrypt a password hash in php before inserting it into the database. The code below will reveal this information. $1$aGwdyCbv$dwOWTv3mGDXIH0tHK7Ova1 hash [code]<?php $passwordtohash = ‘mypassword’; $hash = crypt($passwordtohash); echo $hash; echo $passwordtohas; ?>[/code] Explaining the Crypt Code and Process The php variable of $pass is holding within it “hash”. We then Read More

Retrieving Data From MySql with PHP

Retrieving Data From MySql with PHP

Retrieving data from MySql with PHP is a simple process however you should have the following things set up before implementing this process. You Created A Database You Granted Privileges to the database Created a config.php file to access the database After you insert data into a database you will eventually need to be retrieving data Read More