Allow MySQL User Account to Connect from Any Host

vanithasree
Updated on 20-Jun-2020 11:50:03

3K+ Views

It is quite possible to allow a user account to connect from any host. To do so we need to create the user with the help of ‘%’ wild card character after @ character. Its syntax would be as follows −Use mysql; CREATE USER user_name@’%’ IDENTIFIED BY password;Here user_name is the name of the user we wish to make an account for.Password is the password we wish to make for user_account. With the help of this password, MySQL server will identify this user.ExampleIn the given example we are creating a user ‘Gaurav’ by using ‘%’ character so that it can be ... Read More

What are Dynamic Arrays in C#

karthikeya Boyini
Updated on 20-Jun-2020 11:49:55

6K+ Views

Dynamic arrays are growable arrays and have an advantage over static arrays. This is because the size of an array is fixed.To create arrays dynamically in C#, use the ArrayList collection. It represents an ordered collection of an object that can be indexed individually. It also allows dynamic memory allocation, adding, searching and sorting items in the list.The following is an example showing how to create arrays dynamically in C# −Example Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          ArrayList al = new ArrayList(); ... Read More

Split Name String into Three Parts Using MySQL SUBSTRING_INDEX Function

Sharon Christine
Updated on 20-Jun-2020 11:49:23

295 Views

To make it understand, we are using the following data from a table named ‘customerdetail’.mysql> Select * from Customerdetail; +----------------------+----------------------+----------+---------------------+ | Name                 | FName                | Address  | Emailid             | +----------------------+----------------------+----------+---------------------+ | Advik Jhamb          | Lovkesh Jhamb        | Mumbai   | Advik@gmail.com     | | Chirag Jai Patil     | Raman Jai Patil      | Gujrat   | chirahp@yahoo.com   | | Devansh Singh Rajput | Kishore Singh Rajput | ... Read More

Remove Prefixes or Suffixes from a String in MySQL

Akshaya Akki
Updated on 20-Jun-2020 11:48:45

2K+ Views

MySQL TRIM() function is used to remove all the suffixes or prefixes or both from the string. The working of TRIM() function can be understood with the help of its syntax −SyntaxTRIM([{BOTH | LEADING | TRAILING} [str_to_remove] FROM] string)Here,  the argument BOTH means the prefixes from both left and right to be removed from the string.LEADING argument means that only leading prefixes to be removed.TRAILING argument means that only trailing prefixes to be removed.Str_to_remove is the argument which means the string we want to remove from the string.String argument means the string from which the prefixes have to be removed.Examplemysql> ... Read More

Use Null Coalescing Operator in C#

Samual Sam
Updated on 20-Jun-2020 11:48:30

2K+ Views

The null coalescing operator is used with the nullable value types and reference types. It is used for converting an operand to the type of another nullable (or not) value type operand, where an implicit conversion is possible.If the value of the first operand is null, then the operator returns the value of the second operand, otherwise, it returns the value of the first operand.The following is an example −Example Live Demousing System; namespace Demo {    class Program {       static void Main(string[] args) {          double? num1 = null;     ... Read More

Create MySQL User Account by Omitting Hostname

seetha
Updated on 20-Jun-2020 11:47:50

437 Views

If we omit the hostname part of the user account, MySQL will accept it and allow the user to connect from any host. Its syntax would be as follows −Use mysql; CREATE USER user_name IDENTIFIED BY password;Here, user_name is the name of the user we wish to take account of.Password is the password we wish to make for user_account. With the help of this password, MySQL server will identify this user.ExampleIn the given example we are creating a user ‘REMOTE’ by omitting the host name.mysql> CREATE USER remote identified by 'password123'; Query OK, 0 rows affected (0.00 sec)The user ‘Remote’ can ... Read More

Programs Available in MySQL Database to Manage MySQL Server

V Jyothi
Updated on 20-Jun-2020 11:44:48

193 Views

MySQL database provides us the following programs as administrative tools to manage MySQL server −mysqldIt is also known as MySQL server daemon. It is the main program that does most of the work in a MySQL installation. We need to use ‘mysqld’ to start our MySQL server. It is having many options that can be specified at the time of startup.mysqladminProcessing Re-write Suggestions Done (Unique Article)Basically ‘mysqladmin’ could be a client for playacting administrative operations. we are able to use it to see the server’s configuration and current status, to create and drop databases, and plenty of a lot of.For ... Read More

Call a Method of a Class in C#

karthikeya Boyini
Updated on 20-Jun-2020 11:43:43

3K+ Views

To call a method, use the name of the method after the object name, for example, −obj1. Display();Let’s say the class name is ApplicationOne, so to call the method −ApplicationOne one = new ApplicationOne(); //calling the displayMax method ret = one.displayMax(a, b);The following is the example showing how to call a method in C# −Example Live Demousing System; namespace Demp {    class ApplicationOne {       public int displayMax(int num1, int num2) {          /* local variable declaration */          int result;          if (num1 > num2) ... Read More

Change MySQL User Password Using UPDATE Statement

Giri Raju
Updated on 20-Jun-2020 11:43:23

3K+ Views

To change MySQL user password with the help of UPDATE statement, we need to update the ‘user’ table of the ‘mysql’ database. Its syntax would be as follows −SyntaxUSE mysql; UPDATE user SET authentication_string = PASSWORD(‘new_password’) WHERE user = user_name AND host = host_name;The first two statements will be common because to change the password for MySQL user we need to use MySQL database and update the user table.New_password would be new password we want to set for MySQL userUser_name is the name of the current user.Host_name is the name of the host of the current user.ExampleSuppose if we want ... Read More

Calculate Length of String Using Chash

Ankith Reddy
Updated on 20-Jun-2020 11:42:42

12K+ Views

Use the String.Length property in C# to get the length of the string.str.LengthThe property calculates the words in the string and displays the length of the specified string, for example, the string Amit has 4 characters −string str = "Amit";ExampleThe following is the C# program to calculate the string length − Live Demousing System; using System.Collections; namespace Demo {    class Program {       static void Main(string[] args) {          string str = "Amit";          Console.WriteLine("String: "+str);          Console.WriteLine("String Length: "+str.Length);          Console.ReadKey();       }    } }OutputString: Amit String Length: 4

Advertisements