I have learned MySql in my school, but on CMD Prompt. Since i want to use that knowledge and want to create a GUI program in ruby (NOT A RUBY-ON-RAILS PROJECT) which use MySql commands like:
SHOW DATABASES;
USE DATABASE ruby;
SELECT * FROM TABLE staff;
CREATE TABLE STUDENT(Rollno integer, Class integer);
INSERT INTO STUDENT VALUES(32, 12);
SHOW TABLES;
DROP TABLE STUDENT;
etc. and etc...
but i am unable to find about that, i have found mysql2 gemfile but it doesn't supports the command in my code, in
require 'mysql2'
client = Mysql2::Client.new(hostname: 'localhost', username: 'root', password: '1234', database: 'ruby')
list = client.query("SHOW TABLES")
list.each do |item|
puts item
end
No output and I'm just frustrated
Please give Suggestions
WITH THE CONTIBUTION OF @URSUS, WE HAVE SOLVED THIS, WE RECHECKED THE MySql GEMFILE AND RECHECK THE Table in Database AND USE irb
look over at this link: https://drive.google.com/open?id=19YUhmcLeMJn9aNEjM0bQNjpHIWrPZ0RX
mysql2driver is pretty feeble. This code won't produce output unless you have tables defined in that database.