LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 43 of 106
0 votes
1 ans
3 views
Change MySQL default character set to UTF-8 in my.cnf?

Currently we are using the following commands in PHP to set the character set to [UTF-8][1] in our application. Since this is a bit of overhead, we'd li...

database Solved
JO
asked 1 month ago by Jorre
0 votes
1 ans
3 views
How to use multiple databases in Laravel

I want to combine multiple databases in my system. Most of the time the database is MySQL; but it may differ in future i.e. Admin can generate such a reports w...

database Solved
CH
asked 1 month ago by Chintan7027
0 votes
1 ans
3 views
How to rename a table in MySQL?

Renaming a table is not working in MySQL: ```sql RENAME TABLE group TO member; ``` The error message is: ``` #1064 - You have an error in your SQL syntax;...

database Solved
AN
asked 1 month ago by Anil Olakkal
0 votes
1 ans
3 views
Best practices for SQL varchar column length

Every time is set up a new SQL table or add a new `varchar` column to an existing table, I am wondering one thing: what is the best value for the `length`....

database Solved
ES
asked 1 month ago by esskar
0 votes
1 ans
3 views
ERROR 2006 (HY000): MySQL server has gone away

I get this error when I try to source a large SQL file (a big `INSERT` query). mysql> source file.sql ERROR 2006 (HY000): MySQL server has gone...

server-admin Solved
BE
asked 1 month ago by Ben G
0 votes
1 ans
3 views
Log all queries in mysql

Is it possible for me to turn on audit logging on my mysql database? I basically want to monitor all queries for an hour, and dump the log to a file.

database Solved
PU
asked 1 month ago by public static
0 votes
1 ans
3 views
Can table columns with a Foreign Key be NULL?

I have a table which has several ID columns to other tables. I want a foreign key to force integrity **only** if I put data in there. If I do an update at a...

database Solved
BE
asked 1 month ago by bender
0 votes
1 ans
3 views
#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

I have a WordPress website on my local **WAMP** server. But when I upload its database to live server, I get error #1273 – Unknown collation: ‘utf8mb4_u...

general-dev Solved
SH
asked 1 month ago by Shishil Patel
0 votes
1 ans
3 views
How do you get the rows that contain the max value for each grouped set in MySQL

I've seen some overly-complicated variations on this question, and none with a good answer. I've tried to put together the simplest possible example:...

database Solved
YA
asked 1 month ago by Yarin
0 votes
1 ans
3 views
Search text in fields in every table of a MySQL database

I want to search in all fields from all tables of a MySQL database a given string, possibly using syntax as: SELECT * FROM * WHERE * LIKE '%stuff%&#3...

database Solved
RS
asked 1 month ago by RSilva
0 votes
1 ans
3 views
Compare two MySQL databases

I'm currently developing an application using a MySQL database. The database-structure is still in flux and changes while development progresses (I chang...

database Solved
VI
asked 1 month ago by Vincent Ramdhanie
0 votes
1 ans
3 views
Database sharding vs partitioning

I have been reading about scalable architectures recently. In that context, two words that keep on showing up with regards to databases are *sharding* and *part...

database Solved
AM
asked 1 month ago by Amit Sharma
0 votes
1 ans
3 views
gem install: Failed to build gem native extension (can't find header files)

I am using Fedora 14 and I have MySQL and MySQL server 5.1.42 installed and running. Now I tried to do this as root user: gem install mysql But I get...

general-dev Solved
TI
asked 1 month ago by Tim
0 votes
1 ans
3 views
How to get the max of two values in MySQL?

I tried but failed: mysql> select max(1,0); <pre> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that correspo...

database Solved
MA
asked 1 month ago by Mask
0 votes
1 ans
3 views
Rename a column in MySQL

I am trying to rename a column in `MySQL` community server `5.5.27` using this SQL expression: ALTER TABLE table_name RENAME COLUMN old_col_name TO new_c...

database Solved
MI
asked 1 month ago by Michael Okoli
0 votes
1 ans
3 views
Adding multiple columns after a specific column with a single ADD COLUMN statement results in a syntax error

I need to add multiple columns to a table but position the columns **after** a column called `lastname`. I have tried this: ALTER TABLE `users` ADD CO...

general-dev Solved
KO
asked 1 month ago by Koala
0 votes
1 ans
3 views
Error related to only_full_group_by when executing a query in MySql

I have upgraded my system and have installed MySql 5.7.9 with php for a web application I am working on. I have a query that is dynamically created, and when ru...

database Solved
DA
asked 1 month ago by Dan Bemowski
0 votes
1 ans
3 views
Difference between VARCHAR and TEXT in MySQL

When we create a table in MySQL with a `VARCHAR` column, we have to set the length for it. But for `TEXT` type we don't have to provide the length. What...

database Solved
US
asked 1 month ago by user3840485
0 votes
1 ans
3 views
MySQL error 1449: The user specified as a definer does not exist

When I run the following query I get an error: SELECT `a`.`sl_id` AS `sl_id`, `a`.`quote_id` AS `quote_id`,...

database Solved
TE
asked 1 month ago by Tech MLG
0 votes
1 ans
3 views
What is the ideal data type to use when storing latitude / longitude in a MySQL database?

Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database?

database Solved
CO
asked 1 month ago by Codebeef