Friday, November 22, 2019
Use the USE Command in MySQL to Switch Databases
Use the USE Command in MySQL to Switch Databases Creating a database in MySQL doesnt select it for use. You have to indicate it with the USE command. The USE command is also used when you have more than one database on a MySQL server and need to switch between them. You must choose the correct database each time you start a MySQL session.à The USE Command in MySQL The syntax for the USE command is: mysqlà ââ¬â¹ For example, this codeà switches to the database named Dresses. mysqlà ââ¬â¹Ã¢â¬â¹ After you select a database, it remains the default until you end the session or choose another database with the USE command. Identifying the Current Database If you are unsure which database is currently in use, use the following code: This code returns the name of the database currently in use. If no database is currently in use, it returns NULL. To view a list of available databases, use: About MySQL MySQL is an open-source relational database management system that is most often associated with web-based applications. It is the database software of choice for many of the webs largest sites including Twitter, Facebook, and YouTube. It is also the most popular database managementà system for small and medium-sized websites. Almost every commercial web host offersà MySQL services. If you are just using MySQL on a website, you wont need to be involved with the coding- the web host will handle all that- but if you are a developer new to MySQL, youll need to learn SQL to write programs that access MySQL.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.