![]() ![]() PS C:\Users\NBUSER\Documents\ARTOFWAR\PITON\02-piton> & C:/Users/NBUSER/AppData/Local/Programs/Python/Python39/python.exe c:/Users/NBUSER/Documents/ARTOFWAR/PITON/02-piton/aldo/chgdbname.pyįile "C:\Users\NBUSER\AppData\Local\Programs\Python\Python39\lib\site-packages\mysql\connector\connection. ![]() : 1064 (42000): You have an error in your SQL syntax check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE test to test1' at line 1 Result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query)) Self._handle_result(self._connection.cmd_query(stmt))įile "C:\Users\NBUSER\AppData\Local\Programs\Python\Python39\lib\site-packages\mysql\connector\connection.py", line 846, in cmd_query ![]() Mycursor.execute('RENAME DATABASE test to test1')įile "C:\Users\NBUSER\AppData\Local\Programs\Python\Python39\lib\site-packages\mysql\connector\cursor.py", line 568, in execute Here is the error warning : Traceback (most recent call last):įile "c:\Users\NBUSER\Documents\ARTOFWAR\PITON\02-piton\aldo\chgdbname.py", line 18, in įile "c:\Users\NBUSER\Documents\ARTOFWAR\PITON\02-piton\aldo\chgdbname.py", line 15, in viewdb1 Mycursor.execute('ALTER DATABASE test RENAME to test1') Mydb = (host = 'localhost', user='root', password ='') I try to change the database name using python code, but when i run the program the result give me an error warning. Note: phpMyadmin is the graphical interface for MariaDB 10.I have a database and i give it name "test" then Log into your phpMyadmin / Users accounts / Add user account to create a new user account for the database. Note: If you rename a database and this database has a user account with the same database name, your user account will be automatically deleted from the database. Note: Before you rename any database in your Synology NAS, make a Backup of MariaDB 10 using the Hyper Backup package just in case something goes wrong. When the 5 minutes have passed, your site or application will be back online. Log in to the phpMyAdmin Select database in the left sidebar. It provides you an option to rename the database in the MySQL server. phpMyAdmin is the most popular web application used for managing MySQL databases. You need to wait 5 minutes then refresh the page or you will see an error that says: “ Error establishing a database connection“. Method 2 Rename MySQL Database with phpMyAdmin. The change will not be applied immediately in your NAS DSM. If you run WordPress or any other applications, remember to change the wp-config.php file and, at DB_NAME, add the new database name you have previously created on STEP 4. If everything went well, you will see the new database name in the left sidebar in phpMyAdmin. After that, click on Go at the right of the page. Now scroll down a little bit to see the option “ Rename database to” and, in the box just below it, type in your new database name. After you click on the database, at the top of the page click on the Operations tab. In my case, I have a database named “testing” that I want to rename. On the left sidebar select the database you want to rename. The left side of the main screen of phpMyAdmin is where you will find your database listed, with the table listed. You will be creating a new database with your chosen name, dropping the tables in your original, then importing those tables to your new database. You will be prompted with a pop-up to accept the change. Follow the instructions in the image below. Lets learn how to rename database tables. Under Rename database to, enter the name you would like to see for your database in the text field and click Go on the bottom, right corner of field. Log into phpMyAdmin with your Administrator credentials. Please Support My work by Making a Donation. Have you installed WordPress on your Synology NAS or another application that uses a database but you don’t like the name of the database previously created with MariaDB 10 and want to change it? How can you do that? For one reason or another one day you may need to change the names of your databases. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |