MySql from Windows to ubunto - mysql

i have all table of mysql with examp as files now i install ubuntu i want to get databases in ubuntu sql just i had copy mysql from data to var/lib/mysql
but when i brows tables give me this error
/libraries/tbl_columns_definition_form.inc.php#243
Undefined index: Default
Backtrace
./libraries/controllers/table/TableStructureController.php#513: include(./libraries/tbl_columns_definition_form.inc.php)
./libraries/controllers/table/TableStructureController.php#179: PMA\libraries\controllers\table\TableStructureController->displayHtmlForColumnChange(
array,
string 'tbl_structure.php',
)
./tbl_structure.php#49: PMA\libraries\controllers\table\TableStructureController->indexAction()

Related

connecting MySQL database to copied and pasted data directory

I copied a database directory from the datadir (/var/lib/mysql/) of a MySQL instance running on a server to my local machine. Is it possible to put this database directory into my local MySQL datadir and access that database?
What I have done so far is copy the database directory like above, I log in to the MySQL and can see the database, I switch to it and can list all the tables. But when ever I try to query a table I get something like:
select * from users limit 1;
ERROR 1146 (42S02): Table 'users' doesn't exist
Also from mysqldump:
mysqldump: Got error: 1146: Table 'very_first_table' doesn't exist when using LOCK TABLES
Is it possible to do what I am trying to do here?
So I got it to work, bare in mind that my end goal was to get a database dump from the database. The mysql folder was extracted from a older virtual machine snapshot which could not be run at the moment, so I couldn't just log in to it and do a normal dump. Here is what I did:
1) I installed mysql on a fresh vm on my local machine
2) I shut down mysql with service mysql stop
3) I removed the existing /var/lib/mysql folder from the fresh install
4) I replaced it with the /var/lib/mysql folder that was removed from the old snapshot
5) I ran chown -R mysql:mysql /var/lib/mysql
6) I restarted mysql with service mysql start
7) Then I checked if I could log in and query the tables, I could!
So I was able to run the dump after that.

Restoring database after reinstallation of MySQL

I had to reinstall MySQL some time ago, before doing it I had moved /var/lib/mysql/mydatabase to another directory to be able to restore it after installation of MySQL.
After I installed MySQL I moved back this directory. When I go to mysql console and use
SHOW DATABASES;
it returns list of databases and 'mydatabase' is among the list.
When I switch to using 'mydatabase' and use
SHOW TABLES;
it shows the list of tables, but when I do any SELECT command I get this error:
ERROR 1146 (42S02): Table 'mydatabase.mytable1' doesn't exist
From the very beginning - was it enough to backup only /var/lib/mysql/< DATABASE_NAME > to restore database data or have I missed something? If yes then what I could try to fix this issue with 'table doesn't exist'?
MySQL version is 5.7, OS is Ubuntu 16.04
MySQL 5.7 default storage Engine is InnoDB. This stores the data in ibdata,ib_logfile0, and ib_logfile1. If you haven't backed up these files then you cannot restore the data.
It is suggestible that instead of moving your database files we should use mysqldump utility.
It is better to use innodb-file-per-table which can store InnoDB tables in a .ibd file per tables.

Error while installing Koha

I get this error when installing via the web installer, the error says:
DBIx::Class::Storage::DBI::_dbh_execute(): Data truncated for column 'type' at row 1 at /usr/share/koha/lib/Koha/Objects.pm line 101
Installed version is: 16.05.05.000
I installed using packages by following the instructions on this link: https://wiki.koha-community.org/wiki/Koha_on_Debian
The database I'm using is: MySQL database; and it is on the same machine as Koha.
Any idea please!
I was presented with the same error. It appears that the error is given in an enum column in the database. For MySQL you can solve it as follows (inside the MySQL database administrator):
SET GLOBAL sql_mode = '';
When setting the mode with an empty string '' you are telling MySQL not to take into account some errors that arise when inserting data.
MySQL can operate in different modes, some modes are more restrictive than others, for example, some modes do not allow certain operations, such as division by zero or restrict the way in which the dates are represented in the database.
To see how the server is, you must log into MySQL from the command line:
mysql -u root -p
If the MySQL server does not have a password (which is not recommended), omit the -p parameter. You can then check the mode with the following command
SELECT ##GLOBAL.sql_mode;
It will return more or less similar to this:
STRICT_TRANS_TABLES, NO_ENGINE_SUBSTITUTION
You can find more information on this at http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html
Source
install phpmyadmin on different port (say 81)
select koha_library database (where library is the instance)
select ‘search_filed’ table
press ‘structure’ tap
select 'type' column and then press 'change'
change the type to varchar and length to 255 (or you can change the type of column 'type'in table ‘search_filed’ from enum to varchar(255) using the terminal)
execute the following command in server terminal (login using mysql-u root -p ):
SET GLOBAL sql_mode='';
quit;
sudo service mysql restart && sudo service apache2 restart

Failed to connect to a remote MySQL database via an Ubuntu server

I'm trying to connect to a remote MySQL database via an Ubuntu server using a command like:
mysql -u oooo -p -h ooo.ooo.oo.oo
Then it just returned:
mysql: unknown variable 'log=/var/log/mysql/logfile.log'
I've checked that the file 'logfile.log' does not exist and I have no idea what is the next step.
Search your machine for a file named my.cnf. That file will probably contain your offending variable. Comment it out.

Error 2013 in MySQL export database

my MySQL server was working fine, but today I can't connect to this. I get the error "Can't connect to mysql server on 'localhost' (10061)". So I check that the Mysql55 service in my Windows 7 x64 is stopped. I start the service, but when I open a specifically database the server stops. With other databases I don't have any problem.
I try to dump the database to a .sql file and I get the error "mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table table_name at row: 43795". Then the server stops. I try this Error Code: 2013. Lost connection to MySQL server during query but not works.
When I try to export the database in other times, I get the same error, but with a different row value.
It seems while dumping the particular table sending receiving too large data from that table .
use --max_allowed_packet=500M and then dump it..also check your my.ini config file max_allowed_packet variable size you have specified .