Browsed by
Tag: mysql

How to install MySQL in Docker ?

How to install MySQL in Docker ?

How to install MySQL in Docker ? Installing Particular Version [code] sudo docker pull mysql/mysql-server:5.7 [/code]   Installing Latest Version [code] sudo docker pull mysql [/code]   Running MySql Docker Image: [code] sudo docker run –name mysqlcname -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 –restart always -d mysql [/code] -d => to start it automatically when the server started.     Docker useful commands for Beginners: You can also find other useful docker commands here. 1,300 total views, 4 views today

1,300 total views, 4 views today

Connecting aws ec2 mysql from workbench

Connecting aws ec2 mysql from workbench

Hello all, After a lot of struggle I finally made connection to aws ec2 mysql from workbench, posting here to help you guys. Connecting aws ec2 mysql from workbench:     If you are getting any other exceptions then do validate the below steps once again,   Step 1: Creating root user with all the privileges: CREATE USER ‘root’@’18.188.178.178’ IDENTIFIED BY ‘root1’; GRANT ALL PRIVILEGES ON javadomain.* TO ‘root’@’18.188.178.178’; javadomain => database schema (which I created directly in linux mysql…

Read More Read More

513 total views, no views today

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ?

How to connect to CPanel Remote MySql in Java ? When you are having your code in local and you want to connect your remote mysql which is in your cpanel, then you need to follow below steps to connect to it.   Step 1: Login to CPanel and Navigate to Remote MySql   Login to cpanel and navigate to remote mysql which is under databases CPanel Login -> Databases -> Remote MySql -> Click     Step 2: Find…

Read More Read More

1,292 total views, 1 views today

[Resolved] xampp MySQL does not start

[Resolved] xampp MySQL does not start

[Resolved] xampp MySQL does not start   Issue: Mysql does not starts in xampp.   Solution: If you recently changed anything in my.cnf file which is in the below path, C:\xampp\mysql\bin ensure you have reverted everything. Also make sure the below variables have this values only, innodb_log_file_size = 5M innodb_log_buffer_size = 8M If still issue then change the port 3307 from 3306 and try it.   Feel free to comment in the below section to help you better. 851 total views,…

Read More Read More

851 total views, 2 views today

[Solved] I forgot my phpmyadmin password, how to recover it ?

[Solved] I forgot my phpmyadmin password, how to recover it ?

[Solved]I forgot my phpmyadmin password, how to recover it ? In config.inc.php file you can find the password you already gave. config.inc.php file exists in the “xampp\phpMyAdmin\config.inc.php” $cfg[‘Servers’][$i][‘auth_type’]            = ‘config’; $cfg[‘Servers’][$i][‘user’]                 = ‘root’; $cfg[‘Servers’][$i][‘password’]             = ‘pass123’; Thanks for reading! 702 total views, no views today

702 total views, no views today

Autocomplete using jQuery, PHP and MySQL

Autocomplete using jQuery, PHP and MySQL

Autocomplete is a basic mandatory functionality in any web development. It will help user to find the correct item just with partial name/some letters of the item which they know about the item.     Import the below scripts and CSS’s: [plain] <script type=”text/javascript” src=”http://code.jquery.com/jquery-2.1.1.min.js”></script> <script type=”text/javascript” src=”//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js”></script> <script type=”text/javascript” src=”http://ajax.aspnetcdn.com/ajax/jquery.ui/1.11.0/jquery-ui.min.js”></script> <link rel=”stylesheet” href=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css” type=”text/css” /> <link rel=”stylesheet” href=”//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css” type=”text/css” /> [/plain] Note: Bootstrap.js and bootstrap.min.css imported for the better UI, you can remove it if you want only the…

Read More Read More

2,202 total views, no views today

Java With MySQL Select Example

Java With MySQL Select Example

Download the users_test table: Users_test table – Mysql download Loading the Mysql connection: public Connection LoadDriver() { Connection connection = null; try { // Driver Name String mySQLDriver = "org.gjt.mm.mysql.Driver"; // Path/database name [here guru is the database name] String url = "jdbc:mysql://localhost:3306/guru"; Class.forName(mySQLDriver); // User name and password connection = DriverManager.getConnection(url, "root", "pass123"); } catch (Exception exception) { System.err.println("Exception! "); System.err.println(exception.getMessage()); } return connection; } Fetching the records: [Select] public void getRecords(Connection connection) { String query = "SELECT *…

Read More Read More

1,310 total views, 1 views today

count of max in mysql example query

count of max in mysql example query

Count: Count is an aggregate function which returns the count of rows with respect to our query conditions. Max: Max is an aggregate function which returns the max of rows value of a particular column with respect to our query condition. For string which returns the maximum length value instead of occurences. So you have to use count of max to get the more occurences of the same string in the mysql. Query: select searchkey,count(searchkey) as val from search where…

Read More Read More

1,044 total views, 1 views today

Auto increment alter mysql example

Auto increment alter mysql example

Auto increment: If any of your primary field need to be auto incremented. You can alter the column like below or you can create the sequences also for the same. ALTER TABLE search modify COLUMN id INT NOT NULL AUTO_INCREMENT; Here search is the table name. id is the column name. While inserting you can put null or 0 for id(auto increment) column. 870 total views, no views today

870 total views, no views today

Joining more than two tables mysql examples

Joining more than two tables mysql examples

Joining More than two tables – MySql Examples: Create the tables and insert the sample values by running the below queries, empIdName table contains empId and empNamecode empIdSalary table contains empId and empSalaryCode empCodeSalary table contains empSalaryCode and empSalary empNameSalary table contains empNameCode and empName [plain gutter=”false”] create table empIdName (empId int, empNameCode int) create table empCodeName (empNameCode int, empName varchar2(20)) create table empIdSalary (empId int, empSalaryCode int) create table empCodeSalary (empSalaryCode int, empSalary int) insert into empIdName (empId,empNameCode) values…

Read More Read More

768 total views, no views today