Chandu yadav has Published 1163 Articles

Grant a user permission to only view a MySQL view?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

826 Views

To grant a user permission to only view a MySQL view, use the below syntaxGRANT SELECT ON yourDatabaseName.yourViewName TO ' yourUserName@'yourLocalHost';First you need to display all the view names from a table. The syntax is as follows −SHOW FULL TABLES IN yourDatabaseName WHERE TABLE_TYPE LIKE 'VIEW';Now implement the above syntax ... Read More

Byte-compile Python libraries

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

719 Views

Python is an interpreter based language. However it internally compiles the source code to byte code when a script (.py extension) is run and afterwards the bytecode version is automatically removed. When a module (apart from the precompiled built-in modules) is first imported, its compiled version is also automatically built ... Read More

How to take MySQL database backup using MySQL Workbench?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

414 Views

To make MySQL database backup using MySQL, first we need to install MySQL Workbench. Follow the below link to install MySQL workbench.https://dev.mysql.com/downloads/windows/installer/8.0.htmlAfter installing successfully, we need to open MySQL Workbench. Choose the option “Data Export”. Here is the snapshot.Select the database you want to export. You can also set the ... Read More

Python import modules from Zip archives (zipimport)

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

Use of 'zipimport' module makes it possible to import Python modules and packages from ZIP-format archives. This module also allows an item of sys.path to be a string naming a ZIP file archive. Any files may be present in the ZIP archive, but only files .py and .pyc are available ... Read More

How to keep the connection alive in MySQL Workbench?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

691 Views

To keep connection alive in MySQL Workbench, you need to reach at the following location −Edit -> Preferences -> SQL EditorHere is the snapshot of all the options.After clicking the “Edit” menu, we will select “Workbench Preferences” as shown below −Now, select SQL Editor and set an interval. You can ... Read More

Warning control in Python Programs

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

Warning is different from error in a program. If error is encountered, Python program terminates instantly. Warning on the other hand is not fatal. It displays certain message but program continues. Warnings are issued to alert the user of certain conditions which aren't exactly exceptions. Typically warning appears if some ... Read More

Inserting multiple rows in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

6K+ Views

Insert multiple rows in MySQL with the help of “values”. You can enclose the values with parentheses set with comma separation. The syntax is as follows to insert multiple rows in MySQL.insert into yourTableName(yourColumnName1, yourColumnName2, ..............yourColumnNameN) values(value1, value2, ...valueN), (value1, value2, ...valueN), (value1, value2, ...valueN), ...........((value1, value2, ...valueN);Let us now ... Read More

Selecting a single row in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

1K+ Views

If you want to select a single row on the basis of primary key, use the WHERE clause. The syntax is as follows −SELECT * FROM yourTableName WHERE yourPrimaryKeyColumnName = someValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> ... Read More

Sort by date & time in descending order in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

2K+ Views

Let us create a table to sort date and time in ascending order. The query to create a table is as follows −mysql> create table SortByDateAndTime    -> (    -> UserId int,    -> UserName varchar(100),    -> IssueDate date,    -> IssueTime time    -> ); Query OK, ... Read More

Easy way to re-order columns in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:24

8K+ Views

To re-order columns in MySQL, use the ALTER TABLE MODIFY COLUMN. The syntax is as follows -ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type after yourColumnName.To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table reOrderColumn -> ( ... Read More

Advertisements